__metaclass__ is incompatible for python 3

Bug #1236648 reported by fujioka yuuichi
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
fujioka yuuichi
Cinder
Fix Released
Undecided
fujioka yuuichi
OpenStack Compute (nova)
Fix Released
Undecided
fujioka yuuichi
neutron
Fix Released
Undecided
fujioka yuuichi
oslo-incubator
Fix Released
Undecided
fujioka yuuichi
python-keystoneclient
Fix Released
Medium
fujioka yuuichi
python-novaclient
Fix Released
Undecided
fujioka yuuichi

Bug Description

Some class uses __metaclass__ for abc.ABCMeta.
six be used in general for python 3 compatibility.

For example

import abc
import six

six.add_metaclass(abc.ABCMeta)
class FooDriver:

    @abc.abstractmethod
    def bar():
        pass

Changed in ceilometer:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/50211

Changed in ceilometer:
status: New → In Progress
Julien Danjou (jdanjou)
Changed in ceilometer:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/50211
Committed: http://github.com/openstack/ceilometer/commit/5a657dd9477bdf43a075cdaccb29c6c9d8329bac
Submitter: Jenkins
Branch: master

commit 5a657dd9477bdf43a075cdaccb29c6c9d8329bac
Author: fujioka yuuichi <email address hidden>
Date: Tue Oct 8 10:58:50 2013 +0900

    Apply six for metaclass

    __metaclass__ cannot be used in python3.
    six be used in general for python 3 compatibility.

    Change-Id: I1d9909d70bb614c9d1c336d0c492027f5b6b5088
    Closes-Bug: #1236648

Changed in ceilometer:
status: In Progress → Fix Committed
Changed in oslo:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/50607

Changed in oslo:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/50607
Committed: http://github.com/openstack/oslo-incubator/commit/4bfb7a2a772b40c3d4484876b27ec6f19c1a60a4
Submitter: Jenkins
Branch: master

commit 4bfb7a2a772b40c3d4484876b27ec6f19c1a60a4
Author: fujioka yuuichi <email address hidden>
Date: Wed Oct 9 20:56:54 2013 +0900

    Apply six for metaclass

    __metaclass__ cannot be used in python3.
    six be used in general for python 3 compatibility.

    Change-Id: I9fc7a59df3af29b4cc1287c40fa4e883d994a961
    Closes-Bug: #1236648

Changed in oslo:
status: In Progress → Fix Committed
Changed in nova:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/50857

Changed in nova:
status: New → In Progress
Changed in neutron:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/51738

Changed in neutron:
status: New → In Progress
Changed in cinder:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Changed in python-keystoneclient:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Changed in python-novaclient:
assignee: nobody → fujioka yuuichi (fujioka-yuuichi-d)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/52254

Changed in python-keystoneclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/52255

Changed in python-novaclient:
status: New → In Progress
Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/52256

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/52255
Committed: http://github.com/openstack/python-novaclient/commit/362cb18cb4b31da0c4a48ee47318e53a3d9f3d38
Submitter: Jenkins
Branch: master

commit 362cb18cb4b31da0c4a48ee47318e53a3d9f3d38
Author: fujioka yuuichi <email address hidden>
Date: Thu Oct 17 09:54:54 2013 +0900

    Apply six for metaclass

    The way to using metaclass has changed in Python3.

    Python 2.7 way:

    class Foo(object):
      __metaclass__ = FooMeta

    Python 3 way:

    class Foo(object, metaclass=FooMeta):
      ...

    The six.add_metaclass() decorator allows us to use one syntax that
    works for both Python 2.7 and Python 3.

    Change-Id: Ibd31a9f91bac6ec220d802f16c77ee0306e211b3
    Closes-Bug: #1236648

Changed in python-novaclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/50857
Committed: http://github.com/openstack/nova/commit/30dead1425321e76b42e06849ac95c50c662b9f1
Submitter: Jenkins
Branch: master

commit 30dead1425321e76b42e06849ac95c50c662b9f1
Author: fujioka yuuichi <email address hidden>
Date: Thu Oct 10 16:00:27 2013 +0900

    Apply six for metaclass

    __metaclass__ cannot be used in python3.
    six be used in general for python 3 compatibility.

    Change-Id: I6d344b738cea7b9cda07cdc0e7e13fa73afa93b1
    Closes-Bug: #1236648

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/52256
Committed: http://github.com/openstack/cinder/commit/c47bb5b89e04403b46c224c1bda13d3d0e11eedd
Submitter: Jenkins
Branch: master

commit c47bb5b89e04403b46c224c1bda13d3d0e11eedd
Author: fujioka yuuichi <email address hidden>
Date: Thu Oct 17 09:53:30 2013 +0900

    Apply six for metaclass

    __metaclass__ cannot be used in python3.
    six be used in general for python 3 compatibility.

    Change-Id: I1d21c82163a1c00bbf4fbf3c9dd513f1c0591b00
    Closes-Bug: #1236648

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/52254
Committed: http://github.com/openstack/python-keystoneclient/commit/9b6533bbc021854deb3528fd52129b336169b483
Submitter: Jenkins
Branch: master

commit 9b6533bbc021854deb3528fd52129b336169b483
Author: fujioka yuuichi <email address hidden>
Date: Thu Oct 17 09:41:01 2013 +0900

    Apply six for metaclass

    The way to using metaclass has changed in Python3.

    Python 2.7 way:

    class Foo(object):
      __metaclass__ = FooMeta

    Python 3 way:

    class Foo(object, metaclass=FooMeta):
      ...

    The six.add_metaclass() decorator allows us to use one syntax that
    works for both Python 2.7 and Python 3.

    Change-Id: I08703a8b2927f45f4705fe085368d1ebd78b02fa
    Closes-Bug: #1236648

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/51738
Committed: http://github.com/openstack/neutron/commit/6096dd5892f6eca63d14fb41c281fd246c74f893
Submitter: Jenkins
Branch: master

commit 6096dd5892f6eca63d14fb41c281fd246c74f893
Author: fujioka yuuichi <email address hidden>
Date: Thu Oct 10 20:54:40 2013 +0900

    Apply six for metaclass

    __metaclass__ cannot be used in python3.
    six be used in general for python 3 compatibility.

    Change-Id: Ib0d71b9676dc01390679396443575c05975d3b58
    Closes-Bug: #1236648

Changed in neutron:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Changed in ceilometer:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in python-keystoneclient:
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in python-keystoneclient:
milestone: none → 0.4.2
Dolph Mathews (dolph)
Changed in python-keystoneclient:
status: Fix Committed → Fix Released
Revision history for this message
melanie witt (melwitt) wrote :

novaclient 2.16.0 released on 2/26/2014

Changed in python-novaclient:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: icehouse-1 → 2014.1
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-1 → 2014.1
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
Thierry Carrez (ttx)
Changed in cinder:
milestone: icehouse-1 → 2014.1
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-1 → 2014.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/93313
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=14991ddf9ce7db3a7873b4aa5f8dfa5d61c9b1d9
Submitter: Jenkins
Branch: master

commit 14991ddf9ce7db3a7873b4aa5f8dfa5d61c9b1d9
Author: Steven Gonzales <email address hidden>
Date: Mon May 12 07:51:13 2014 -0700

    Metaclass Python 3.x Compatibility

    According to the OpenStack style guide
    (http://docs.openstack.org/developer/hacking/),
    for Python 3.x compatibility use "six.add_metaclass"
    instead of " __metaclass__."

    Closes-Bug: #1236648
    Change-Id: I2f507a90ee08cc05bd764549002a4656c187b6fc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.