summaryrefslogtreecommitdiff
path: root/nova/keymgr
diff options
context:
space:
mode:
authorfujioka yuuichi <fujioka-yuuichi@zx.mxh.nes.nec.co.jp>2013-10-10 16:00:27 +0900
committerfujioka yuuichi <fujioka-yuuichi@zx.mxh.nes.nec.co.jp>2013-10-23 15:00:42 +0900
commit30dead1425321e76b42e06849ac95c50c662b9f1 (patch)
treea8d100692939778dabbddd5314f2a6c7495d65c6 /nova/keymgr
parentf8227fc0af0808d69ea25a975bfd231885f391a2 (diff)
downloadnova-30dead1425321e76b42e06849ac95c50c662b9f1.tar.gz
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
Diffstat (limited to 'nova/keymgr')
-rw-r--r--nova/keymgr/key.py5
-rw-r--r--nova/keymgr/key_mgr.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/nova/keymgr/key.py b/nova/keymgr/key.py
index 644cf34c4d..8f9903e23e 100644
--- a/nova/keymgr/key.py
+++ b/nova/keymgr/key.py
@@ -25,12 +25,13 @@ from Java.
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.
diff --git a/nova/keymgr/key_mgr.py b/nova/keymgr/key_mgr.py
index bd5669fa56..b47c79e905 100644
--- a/nova/keymgr/key_mgr.py
+++ b/nova/keymgr/key_mgr.py
@@ -20,7 +20,10 @@ Key manager API
import abc
+import six
+
+@six.add_metaclass(abc.ABCMeta)
class KeyManager(object):
"""Base Key Manager Interface
@@ -28,8 +31,6 @@ class KeyManager(object):
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):