__metaclass__ cannot be used in python3.
six be used in general for python 3 compatibility.
Change-Id: I1d21c82163a1c00bbf4fbf3c9dd513f1c0591b00
Closes-Bug: #
1236648
from cinder import wsgi
from lxml import etree
+import six
from xml.dom import minidom
from xml.parsers import expat
cls_dict)
+@six.add_metaclass(ControllerMetaclass)
class Controller(object):
"""Default controller."""
- __metaclass__ = ControllerMetaclass
-
_view_builder_class = None
def __init__(self, view_builder=None):
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class Key(object):
"""Base class to represent all keys."""
- __metaclass__ = abc.ABCMeta
-
@abc.abstractmethod
def get_algorithm(self):
"""Returns the key's algorithm.
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class KeyManager(object):
"""Base Key Manager Interface
Key Manager is responsible for creating, reading, and deleting keys.
"""
- __metaclass__ = abc.ABCMeta
-
@abc.abstractmethod
def create_key(self, ctxt, algorithm='AES', length=256, expiration=None,
**kwargs):
import abc
import threading
+import six
+
from cinder.openstack.common import uuidutils
from cinder.taskflow import decorators
from cinder.taskflow import utils
+@six.add_metaclass(abc.ABCMeta)
class Flow(object):
"""The base abstract class of all flow implementations.
- soft_reset
"""
- __metaclass__ = abc.ABCMeta
-
# Common states that certain actions can be performed in. If the flow
# is not in these sets of states then it is likely that the flow operation
# can not succeed.
import abc
+import six
+
from cinder.taskflow import utils
+@six.add_metaclass(abc.ABCMeta)
class Task(object):
"""An abstraction that defines a potential piece of work that can be
applied and can be reverted to undo the work as a single unit.
"""
- __metaclass__ = abc.ABCMeta
-
def __init__(self, name):
self.name = name
# An *immutable* input 'resource' name set this task depends