mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 05:32:45 +00:00
Reformat everything.
This commit is contained in:
parent
3f2213791a
commit
340ff8586d
1008 changed files with 61301 additions and 58309 deletions
|
|
@ -70,14 +70,13 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
|
||||
|
||||
class ImageFacts:
|
||||
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
|
||||
self.filters = module.params['filters']
|
||||
self.filters = module.params["filters"]
|
||||
|
||||
def return_all_installed_images(self):
|
||||
cmd = [self.module.get_bin_path('imgadm'), 'list', '-j']
|
||||
cmd = [self.module.get_bin_path("imgadm"), "list", "-j"]
|
||||
|
||||
if self.filters:
|
||||
cmd.append(self.filters)
|
||||
|
|
@ -85,17 +84,16 @@ class ImageFacts:
|
|||
(rc, out, err) = self.module.run_command(cmd)
|
||||
|
||||
if rc != 0:
|
||||
self.module.exit_json(
|
||||
msg='Failed to get all installed images', stderr=err)
|
||||
self.module.exit_json(msg="Failed to get all installed images", stderr=err)
|
||||
|
||||
images = json.loads(out)
|
||||
|
||||
result = {}
|
||||
for image in images:
|
||||
result[image['manifest']['uuid']] = image['manifest']
|
||||
result[image["manifest"]["uuid"]] = image["manifest"]
|
||||
# Merge additional attributes with the image manifest.
|
||||
for attrib in ['clones', 'source', 'zpool']:
|
||||
result[image['manifest']['uuid']][attrib] = image[attrib]
|
||||
for attrib in ["clones", "source", "zpool"]:
|
||||
result[image["manifest"]["uuid"]][attrib] = image[attrib]
|
||||
|
||||
return result
|
||||
|
||||
|
|
@ -115,5 +113,5 @@ def main():
|
|||
module.exit_json(**data)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue