Merge pull request #12446 from mcsalgado/dict_get

Use dict.get()
pull/12447/head
James Cammarata 9 years ago
commit 3f5ea43fb8

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

Loading…
Cancel
Save