mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 04:24:00 -07:00
pep8 fixes for contrib (#24344)
This commit is contained in:
parent
c7ae6b9fd5
commit
d3249e7875
37 changed files with 326 additions and 380 deletions
|
@ -110,9 +110,9 @@ class CobblerInventory(object):
|
|||
if self.args.host:
|
||||
data_to_print += self.get_host_info()
|
||||
else:
|
||||
self.inventory['_meta'] = { 'hostvars': {} }
|
||||
self.inventory['_meta'] = {'hostvars': {}}
|
||||
for hostname in self.cache:
|
||||
self.inventory['_meta']['hostvars'][hostname] = {'cobbler': self.cache[hostname] }
|
||||
self.inventory['_meta']['hostvars'][hostname] = {'cobbler': self.cache[hostname]}
|
||||
data_to_print += self.json_format_dict(self.inventory, True)
|
||||
|
||||
print(data_to_print)
|
||||
|
@ -179,7 +179,7 @@ class CobblerInventory(object):
|
|||
|
||||
for host in data:
|
||||
# Get the FQDN for the host and add it to the right groups
|
||||
dns_name = host['hostname'] #None
|
||||
dns_name = host['hostname'] # None
|
||||
ksmeta = None
|
||||
interfaces = host['interfaces']
|
||||
# hostname is often empty for non-static IP hosts
|
||||
|
@ -229,11 +229,11 @@ class CobblerInventory(object):
|
|||
# Need to load index from cache
|
||||
self.load_cache_from_cache()
|
||||
|
||||
if not self.args.host in self.cache:
|
||||
if self.args.host not in self.cache:
|
||||
# try updating the cache
|
||||
self.update_cache()
|
||||
|
||||
if not self.args.host in self.cache:
|
||||
if self.args.host not in self.cache:
|
||||
# host might not exist anymore
|
||||
return self.json_format_dict({}, True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue