mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Various simple linting type cleanups on modules
This commit is contained in:
@@ -235,7 +235,6 @@ def create_image(module, ec2):
|
||||
for img in images:
|
||||
if img.name == name:
|
||||
module.exit_json(msg="AMI name already present", image_id=img.id, state=img.state, changed=False)
|
||||
sys.exit(0)
|
||||
else:
|
||||
module.fail_json(msg="Error in retrieving duplicate AMI details")
|
||||
else:
|
||||
@@ -313,7 +312,6 @@ def deregister_image(module, ec2):
|
||||
module.fail_json(msg = "timed out waiting for image to be reregistered/deleted")
|
||||
|
||||
module.exit_json(msg="AMI deregister/delete operation complete", changed=True)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def update_image(module, ec2):
|
||||
|
||||
@@ -179,7 +179,6 @@ def main():
|
||||
|
||||
if state == 'list':
|
||||
module.exit_json(changed=False, tags=tagdict)
|
||||
sys.exit(0)
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
|
||||
@@ -404,7 +404,7 @@ def modify_dot_attribute(module, ec2, instance, device_name):
|
||||
dot = instance.block_device_mapping[device_name].delete_on_termination
|
||||
except boto.exception.BotoServerError, e:
|
||||
module.fail_json(msg = "%s: %s" % (e.error_code, e.error_message))
|
||||
|
||||
|
||||
if delete_on_termination != dot:
|
||||
try:
|
||||
bdt = BlockDeviceType(delete_on_termination=delete_on_termination)
|
||||
@@ -413,7 +413,7 @@ def modify_dot_attribute(module, ec2, instance, device_name):
|
||||
|
||||
ec2.modify_instance_attribute(instance_id=instance.id, attribute='blockDeviceMapping', value=bdm)
|
||||
|
||||
while instance.block_device_mapping[device_name].delete_on_termination != delete_on_termination:
|
||||
while instance.block_device_mapping[device_name].delete_on_termination != delete_on_termination:
|
||||
time.sleep(3)
|
||||
instance.update()
|
||||
changed = True
|
||||
|
||||
@@ -520,7 +520,6 @@ def main():
|
||||
|
||||
# Use this snippet to debug through conditionals:
|
||||
# module.exit_json(msg="Bucket return %s"%bucketrtn)
|
||||
# sys.exit(0)
|
||||
|
||||
# Lets check the src path.
|
||||
pathrtn = path_check(src)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/python
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# This file is part of Ansible
|
||||
|
||||
Reference in New Issue
Block a user