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__." Change-Id: Ic7733a22294ecad30d185851d4f550f1386581fc
This commit is contained in:
parent
0494edc559
commit
1a6e18eb45
@ -39,10 +39,10 @@ def get_invalid_property(validation_error):
|
||||
return validation_error.schema_path[1]
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class ValidatorBase(object):
|
||||
"""Base class for validators."""
|
||||
|
||||
__metaclass__ = abc.ABCMeta
|
||||
name = ''
|
||||
|
||||
@abc.abstractmethod
|
||||
|
@ -18,6 +18,7 @@ import abc
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto import Random
|
||||
from oslo.config import cfg
|
||||
import six
|
||||
|
||||
from barbican.openstack.common.gettextutils import _
|
||||
|
||||
@ -121,11 +122,10 @@ def indicate_bind_completed(kek_meta_dto, kek_datum):
|
||||
kek_datum.plugin_meta = kek_meta_dto.plugin_meta
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class CryptoPluginBase(object):
|
||||
"""Base class for Crypto plugins."""
|
||||
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@abc.abstractmethod
|
||||
def encrypt(self, encrypt_dto, kek_meta_dto, keystone_id):
|
||||
"""Encrypt unencrypted data in the context of the provided tenant.
|
||||
|
@ -18,6 +18,8 @@ Task resources for the Barbican API.
|
||||
"""
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from barbican import api
|
||||
from barbican.common import resources as res
|
||||
from barbican.common import utils
|
||||
@ -29,11 +31,10 @@ from barbican.openstack.common import gettextutils as u
|
||||
LOG = utils.getLogger(__name__)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class BaseTask(object):
|
||||
"""Base asychronous task."""
|
||||
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_name(self):
|
||||
"""A hook method to return a short localized name for this task.
|
||||
|
Loading…
x
Reference in New Issue
Block a user