mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Bulk autopep8 (modules)
As agreed in 2017-12-07 Core meeting bulk fix pep8 issues Generated using: autopep8 1.3.3 (pycodestyle: 2.3.1) autopep8 -r --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules Manually fix issues that autopep8 has introduced
This commit is contained in:
parent
d13d7e9404
commit
c57a7f05e1
314 changed files with 3462 additions and 3383 deletions
|
@ -186,7 +186,7 @@ class EcsExecManager:
|
|||
family=service_name,
|
||||
desiredStatus=status
|
||||
)
|
||||
if len(response['taskArns'])>0:
|
||||
if len(response['taskArns']) > 0:
|
||||
for c in response['taskArns']:
|
||||
if c.endswith(service_name):
|
||||
return c
|
||||
|
@ -209,13 +209,13 @@ class EcsExecManager:
|
|||
if cluster:
|
||||
args['cluster'] = cluster
|
||||
if task_definition:
|
||||
args['taskDefinition']=task_definition
|
||||
args['taskDefinition'] = task_definition
|
||||
if overrides:
|
||||
args['overrides']=overrides
|
||||
args['overrides'] = overrides
|
||||
if container_instances:
|
||||
args['containerInstances']=container_instances
|
||||
args['containerInstances'] = container_instances
|
||||
if startedBy:
|
||||
args['startedBy']=startedBy
|
||||
args['startedBy'] = startedBy
|
||||
response = self.ecs.start_task(**args)
|
||||
# include tasks and failures
|
||||
return response['tasks']
|
||||
|
@ -224,17 +224,18 @@ class EcsExecManager:
|
|||
response = self.ecs.stop_task(cluster=cluster, task=task)
|
||||
return response['task']
|
||||
|
||||
|
||||
def main():
|
||||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
operation=dict(required=True, choices=['run', 'start', 'stop'] ),
|
||||
cluster=dict(required=False, type='str' ), # R S P
|
||||
task_definition=dict(required=False, type='str' ), # R* S*
|
||||
overrides=dict(required=False, type='dict'), # R S
|
||||
count=dict(required=False, type='int' ), # R
|
||||
task=dict(required=False, type='str' ), # P*
|
||||
container_instances=dict(required=False, type='list'), # S*
|
||||
started_by=dict(required=False, type='str' ) # R S
|
||||
operation=dict(required=True, choices=['run', 'start', 'stop']),
|
||||
cluster=dict(required=False, type='str'), # R S P
|
||||
task_definition=dict(required=False, type='str'), # R* S*
|
||||
overrides=dict(required=False, type='dict'), # R S
|
||||
count=dict(required=False, type='int'), # R
|
||||
task=dict(required=False, type='str'), # P*
|
||||
container_instances=dict(required=False, type='list'), # S*
|
||||
started_by=dict(required=False, type='str') # R S
|
||||
))
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||
|
@ -276,7 +277,7 @@ def main():
|
|||
if module.params['operation'] == 'run':
|
||||
if existing:
|
||||
# TBD - validate the rest of the details
|
||||
results['task']=existing
|
||||
results['task'] = existing
|
||||
else:
|
||||
if not module.check_mode:
|
||||
results['task'] = service_mgr.run_task(
|
||||
|
@ -290,7 +291,7 @@ def main():
|
|||
elif module.params['operation'] == 'start':
|
||||
if existing:
|
||||
# TBD - validate the rest of the details
|
||||
results['task']=existing
|
||||
results['task'] = existing
|
||||
else:
|
||||
if not module.check_mode:
|
||||
results['task'] = service_mgr.start_task(
|
||||
|
@ -304,7 +305,7 @@ def main():
|
|||
|
||||
elif module.params['operation'] == 'stop':
|
||||
if existing:
|
||||
results['task']=existing
|
||||
results['task'] = existing
|
||||
else:
|
||||
if not module.check_mode:
|
||||
# it exists, so we should delete it and mark changed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue