mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 20:54:24 -07:00
parent
22cbfacab0
commit
0bbe9d5bd0
3 changed files with 26 additions and 4 deletions
|
@ -78,10 +78,11 @@ class HostVars(collections.Mapping):
|
|||
return False
|
||||
|
||||
def __iter__(self):
|
||||
raise NotImplementedError('HostVars does not support iteration as hosts are discovered on an as needed basis.')
|
||||
for host in self._lookup:
|
||||
yield host
|
||||
|
||||
def __len__(self):
|
||||
raise NotImplementedError('HostVars does not support len. hosts entries are discovered dynamically as needed')
|
||||
return len(self._lookup)
|
||||
|
||||
def __getstate__(self):
|
||||
return dict(loader=self._loader, lookup=self._lookup, play=self._play, var_manager=self._variable_manager)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue