mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Fix invocations of module.fail_json with no msg=
Bonus: add missing % in cs_nic.py
This commit is contained in:
committed by
Brian Coca
parent
91860b2423
commit
ec9582fd83
@@ -232,7 +232,7 @@ def _get_net_id(neutron, module):
|
||||
try:
|
||||
networks = neutron.list_networks(**kwargs)
|
||||
except Exception as e:
|
||||
module.fail_json("Error in listing neutron networks: %s" % e.message)
|
||||
module.fail_json(msg="Error in listing neutron networks: %s" % e.message)
|
||||
if not networks['networks']:
|
||||
return None
|
||||
return networks['networks'][0]['id']
|
||||
|
||||
@@ -182,7 +182,7 @@ def _delete_router(module, neutron, router_id):
|
||||
try:
|
||||
neutron.delete_router(router_id)
|
||||
except:
|
||||
module.fail_json("Error in deleting the router")
|
||||
module.fail_json(msg="Error in deleting the router")
|
||||
return True
|
||||
|
||||
def main():
|
||||
|
||||
@@ -154,7 +154,7 @@ def _get_net_id(neutron, module):
|
||||
try:
|
||||
networks = neutron.list_networks(**kwargs)
|
||||
except Exception as e:
|
||||
module.fail_json("Error in listing neutron networks: %s" % e.message)
|
||||
module.fail_json(msg="Error in listing neutron networks: %s" % e.message)
|
||||
if not networks['networks']:
|
||||
return None
|
||||
return networks['networks'][0]['id']
|
||||
|
||||
@@ -200,7 +200,7 @@ def _get_net_id(neutron, module):
|
||||
try:
|
||||
networks = neutron.list_networks(**kwargs)
|
||||
except Exception as e:
|
||||
module.fail_json("Error in listing neutron networks: %s" % e.message)
|
||||
module.fail_json(msg="Error in listing neutron networks: %s" % e.message)
|
||||
if not networks['networks']:
|
||||
return None
|
||||
return networks['networks'][0]['id']
|
||||
|
||||
Reference in New Issue
Block a user