mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
Merge pull request #2457 from robparrott/add_host-inventory-group-fix
invalidate group cache when adding a new group
This commit is contained in:
commit
92997ec789
1 changed files with 1 additions and 0 deletions
|
@ -288,6 +288,7 @@ class Inventory(object):
|
||||||
|
|
||||||
def add_group(self, group):
|
def add_group(self, group):
|
||||||
self.groups.append(group)
|
self.groups.append(group)
|
||||||
|
self._groups_list = None # invalidate internal cache
|
||||||
|
|
||||||
def list_hosts(self, pattern="all"):
|
def list_hosts(self, pattern="all"):
|
||||||
return [ h.name for h in self.get_hosts(pattern) ]
|
return [ h.name for h in self.get_hosts(pattern) ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue