mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Performance improvements
This commit is contained in:
parent
80385a47bd
commit
d2b3b2c03e
16 changed files with 330 additions and 480 deletions
|
@ -64,12 +64,12 @@ class Host:
|
|||
)
|
||||
|
||||
def deserialize(self, data):
|
||||
self.__init__()
|
||||
self.__init__(gen_uuid=False)
|
||||
|
||||
self.name = data.get('name')
|
||||
self.vars = data.get('vars', dict())
|
||||
self.address = data.get('address', '')
|
||||
self._uuid = data.get('uuid', uuid.uuid4())
|
||||
self._uuid = data.get('uuid', None)
|
||||
self.implicit= data.get('implicit', False)
|
||||
|
||||
groups = data.get('groups', [])
|
||||
|
@ -78,7 +78,7 @@ class Host:
|
|||
g.deserialize(group_data)
|
||||
self.groups.append(g)
|
||||
|
||||
def __init__(self, name=None, port=None):
|
||||
def __init__(self, name=None, port=None, gen_uuid=True):
|
||||
|
||||
self.name = name
|
||||
self.vars = {}
|
||||
|
@ -90,7 +90,9 @@ class Host:
|
|||
self.set_variable('ansible_port', int(port))
|
||||
|
||||
self._gathered_facts = False
|
||||
self._uuid = uuid.uuid4()
|
||||
self._uuid = None
|
||||
if gen_uuid:
|
||||
self._uuid = uuid.uuid4()
|
||||
self.implicit = False
|
||||
|
||||
def __repr__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue