Commit 7dd3ef7b by Toshio Kuratomi

Older python-six from early RHEL and ubuntu do not have add_metaclass but do have with_metaclass

parent f3ccff42
...@@ -20,11 +20,10 @@ __metaclass__ = type ...@@ -20,11 +20,10 @@ __metaclass__ = type
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from six import add_metaclass from six import with_metaclass
@add_metaclass(ABCMeta) class BaseCacheModule(with_metaclass(ABCMeta, object)):
class BaseCacheModule:
@abstractmethod @abstractmethod
def get(self, key): def get(self, key):
......
...@@ -22,7 +22,7 @@ __metaclass__ = type ...@@ -22,7 +22,7 @@ __metaclass__ = type
from abc import ABCMeta, abstractmethod, abstractproperty from abc import ABCMeta, abstractmethod, abstractproperty
from six import add_metaclass from six import with_metaclass
from ansible import constants as C from ansible import constants as C
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
...@@ -34,8 +34,7 @@ from ansible.utils.display import Display ...@@ -34,8 +34,7 @@ from ansible.utils.display import Display
__all__ = ['ConnectionBase'] __all__ = ['ConnectionBase']
@add_metaclass(ABCMeta) class ConnectionBase(with_metaclass(ABCMeta, object)):
class ConnectionBase:
''' '''
A base class for connections to contain common code. A base class for connections to contain common code.
''' '''
......
...@@ -23,10 +23,9 @@ __metaclass__ = type ...@@ -23,10 +23,9 @@ __metaclass__ = type
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from six import add_metaclass from six import with_metaclass
@add_metaclass(ABCMeta) class InventoryParser(with_metaclass(ABCMeta, object)):
class InventoryParser:
'''Abstract Base Class for retrieving inventory information '''Abstract Base Class for retrieving inventory information
Any InventoryParser functions by taking an inven_source. The caller then Any InventoryParser functions by taking an inven_source. The caller then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment