mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-12 19:34:02 -07:00
PEP 8 indent cleanup. (#20800)
* PEP 8 E121 cleanup. * PEP 8 E126 cleanup. * PEP 8 E122 cleanup.
This commit is contained in:
parent
1c6bb4add9
commit
10d9318de7
244 changed files with 2873 additions and 2973 deletions
|
@ -353,12 +353,12 @@ or environment variables (DO_API_TOKEN)\n''')
|
|||
def build_inventory(self):
|
||||
'''Build Ansible inventory of droplets'''
|
||||
self.inventory = {
|
||||
'all': {
|
||||
'hosts': [],
|
||||
'vars': self.group_variables
|
||||
},
|
||||
'_meta': {'hostvars': {}}
|
||||
}
|
||||
'all': {
|
||||
'hosts': [],
|
||||
'vars': self.group_variables
|
||||
},
|
||||
'_meta': {'hostvars': {}}
|
||||
}
|
||||
|
||||
# add all droplets by id and name
|
||||
for droplet in self.data['droplets']:
|
||||
|
@ -379,22 +379,22 @@ or environment variables (DO_API_TOKEN)\n''')
|
|||
|
||||
# groups that are always present
|
||||
for group in [
|
||||
'region_' + droplet['region']['slug'],
|
||||
'image_' + str(droplet['image']['id']),
|
||||
'size_' + droplet['size']['slug'],
|
||||
'distro_' + self.to_safe(droplet['image']['distribution']),
|
||||
'status_' + droplet['status'],
|
||||
'region_' + droplet['region']['slug'],
|
||||
'image_' + str(droplet['image']['id']),
|
||||
'size_' + droplet['size']['slug'],
|
||||
'distro_' + self.to_safe(droplet['image']['distribution']),
|
||||
'status_' + droplet['status'],
|
||||
|
||||
]:
|
||||
]:
|
||||
if group not in self.inventory:
|
||||
self.inventory[group] = { 'hosts': [ ], 'vars': {} }
|
||||
self.inventory[group]['hosts'].append(dest)
|
||||
|
||||
# groups that are not always present
|
||||
for group in [
|
||||
droplet['image']['slug'],
|
||||
droplet['image']['name']
|
||||
]:
|
||||
droplet['image']['slug'],
|
||||
droplet['image']['name']
|
||||
]:
|
||||
if group:
|
||||
image = 'image_' + self.to_safe(group)
|
||||
if image not in self.inventory:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue