1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #12446 from mcsalgado/dict_get

Use dict.get()
This commit is contained in:
James Cammarata 2015-09-20 23:50:39 -04:00
commit 3f5ea43fb8

View file

@ -461,10 +461,7 @@ class Inventory(object):
return matching_host
def get_group(self, groupname):
if groupname in self.groups:
return self.groups[groupname]
else:
return None
return self.groups.get(groupname)
def get_group_variables(self, groupname, update_cached=False, vault_password=None):
if groupname not in self._vars_per_group or update_cached: