mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Older python-six from early RHEL and ubuntu do not have add_metaclass but do have with_metaclass
This commit is contained in:
parent
f3ccff42e5
commit
7dd3ef7b60
3 changed files with 6 additions and 9 deletions
5
lib/ansible/plugins/cache/base.py
vendored
5
lib/ansible/plugins/cache/base.py
vendored
|
@ -20,11 +20,10 @@ __metaclass__ = type
|
|||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
from six import add_metaclass
|
||||
from six import with_metaclass
|
||||
|
||||
|
||||
@add_metaclass(ABCMeta)
|
||||
class BaseCacheModule:
|
||||
class BaseCacheModule(with_metaclass(ABCMeta, object)):
|
||||
|
||||
@abstractmethod
|
||||
def get(self, key):
|
||||
|
|
|
@ -22,7 +22,7 @@ __metaclass__ = type
|
|||
|
||||
from abc import ABCMeta, abstractmethod, abstractproperty
|
||||
|
||||
from six import add_metaclass
|
||||
from six import with_metaclass
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
|
@ -34,8 +34,7 @@ from ansible.utils.display import Display
|
|||
|
||||
__all__ = ['ConnectionBase']
|
||||
|
||||
@add_metaclass(ABCMeta)
|
||||
class ConnectionBase:
|
||||
class ConnectionBase(with_metaclass(ABCMeta, object)):
|
||||
'''
|
||||
A base class for connections to contain common code.
|
||||
'''
|
||||
|
|
|
@ -23,10 +23,9 @@ __metaclass__ = type
|
|||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
from six import add_metaclass
|
||||
from six import with_metaclass
|
||||
|
||||
@add_metaclass(ABCMeta)
|
||||
class InventoryParser:
|
||||
class InventoryParser(with_metaclass(ABCMeta, object)):
|
||||
'''Abstract Base Class for retrieving inventory information
|
||||
|
||||
Any InventoryParser functions by taking an inven_source. The caller then
|
||||
|
|
Loading…
Reference in a new issue