mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use six.with_metaclass to specify metaclasses
Metaclass specification is incompatible between Python 2 and 3. Use the six.with_metaclass helper to specify metaclasses. Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
@@ -54,8 +54,7 @@ class KnobValueError(ValueError):
|
||||
self.name = name
|
||||
|
||||
|
||||
class InnerClass(object):
|
||||
__metaclass__ = util.InnerClassMeta
|
||||
class InnerClass(six.with_metaclass(util.InnerClassMeta, object)):
|
||||
__outer_class__ = None
|
||||
__outer_name__ = None
|
||||
|
||||
@@ -162,15 +161,13 @@ def Knob(type, default=_missing, initializable=_missing, sensitive=_missing,
|
||||
return util.InnerClassMeta('Knob', (KnobBase,), class_dict)
|
||||
|
||||
|
||||
class Configurable(object):
|
||||
class Configurable(six.with_metaclass(abc.ABCMeta, object)):
|
||||
"""
|
||||
Base class of all configurables.
|
||||
|
||||
FIXME: details of validate/execute, properties and knobs
|
||||
"""
|
||||
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@classmethod
|
||||
def knobs(cls):
|
||||
"""
|
||||
@@ -382,9 +379,8 @@ class ComponentMeta(util.InnerClassMeta, abc.ABCMeta):
|
||||
pass
|
||||
|
||||
|
||||
class ComponentBase(InnerClass, Configurable):
|
||||
__metaclass__ = ComponentMeta
|
||||
|
||||
class ComponentBase(
|
||||
six.with_metaclass(ComponentMeta, InnerClass, Configurable)):
|
||||
_order = None
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -159,5 +159,6 @@ class InnerClassMeta(type):
|
||||
self.__outer_class__ = cls
|
||||
self.__outer_name__ = name
|
||||
self.__name__ = '.'.join((cls.__name__, name))
|
||||
self.__qualname__ = self.__name__
|
||||
|
||||
return cls, name
|
||||
|
||||
@@ -31,6 +31,7 @@ import dateutil.parser
|
||||
import dateutil.tz
|
||||
import nss.nss as nss
|
||||
import gssapi
|
||||
import six
|
||||
from six.moves import xrange
|
||||
|
||||
from ipapython import admintool
|
||||
@@ -147,10 +148,8 @@ def convertEncrypted(value, decryptor=None, pconv=base64.b64decode, econv=lambda
|
||||
return None
|
||||
|
||||
|
||||
class XMLKeyDerivation(object):
|
||||
class XMLKeyDerivation(six.with_metaclass(abc.ABCMeta, object)):
|
||||
"Interface for XML Encryption 1.1 key derivation."
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
||||
@abc.abstractmethod
|
||||
def __init__(self, enckey):
|
||||
"Sets up key derivation parameters from the parent XML entity."
|
||||
|
||||
Reference in New Issue
Block a user