mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Lots of formatting fixes
This commit is contained in:
parent
9c5d6f11f0
commit
3a635d2d26
11 changed files with 88 additions and 89 deletions
|
@ -112,7 +112,7 @@ def _get_quantum_client(module, kwargs):
|
|||
'endpoint_url': endpoint
|
||||
}
|
||||
try:
|
||||
quantum = client.Client('2.0', **kwargs)
|
||||
quantum = client.Client('2.0', **kwargs)
|
||||
except Exception as e:
|
||||
module.fail_json(msg = "Error in connecting to quantum: %s " % e.message)
|
||||
return quantum
|
||||
|
@ -127,7 +127,7 @@ def _set_tenant_id(module):
|
|||
for tenant in _os_keystone.tenants.list():
|
||||
if tenant.name == login_tenant_name:
|
||||
_os_tenant_id = tenant.id
|
||||
break;
|
||||
break
|
||||
if not _os_tenant_id:
|
||||
module.fail_json(msg = "The tenant id cannot be found, please check the paramters")
|
||||
|
||||
|
@ -152,9 +152,9 @@ def _create_router(module, quantum):
|
|||
'admin_state_up': module.params['admin_state_up'],
|
||||
}
|
||||
try:
|
||||
new_router = quantum.create_router({'router': router })
|
||||
new_router = quantum.create_router(dict(router=router))
|
||||
except Exception as e:
|
||||
module.fail_json( msg = "Error in creating router: %s" % e.message)
|
||||
module.fail_json( msg = "Error in creating router: %s" % e.message)
|
||||
return new_router['router']['id']
|
||||
|
||||
def _delete_router(module, quantum, router_id):
|
||||
|
@ -191,14 +191,11 @@ def main():
|
|||
else:
|
||||
router_id = _get_router_id(module, quantum)
|
||||
if not router_id:
|
||||
module.exit_json(changed = False, result = "success" )
|
||||
module.exit_json(changed = False, result = "success")
|
||||
else:
|
||||
_delete_router(module, quantum, router_id)
|
||||
module.exit_json(changed = True, result = "deleted" )
|
||||
module.exit_json(changed = True, result = "deleted")
|
||||
|
||||
|
||||
|
||||
|
||||
# this is magic, see lib/ansible/module.params['common.py
|
||||
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue