mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
return None if group does not exist in inventory groups
This commit is contained in:
@@ -457,7 +457,10 @@ class Inventory(object):
|
||||
return matching_host
|
||||
|
||||
def get_group(self, groupname):
|
||||
return self.groups[groupname]
|
||||
if groupname in self.groups:
|
||||
return self.groups[groupname]
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_group_variables(self, groupname, update_cached=False, vault_password=None):
|
||||
if groupname not in self._vars_per_group or update_cached:
|
||||
|
||||
Reference in New Issue
Block a user