mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-29 03:30:22 -07:00
Docs standardization/style
This commit is contained in:
parent
548063a617
commit
e38a83e1ca
1 changed files with 23 additions and 19 deletions
|
@ -211,10 +211,13 @@ def main():
|
||||||
server_info, server_obj = _get_server_state(module, nova)
|
server_info, server_obj = _get_server_state(module, nova)
|
||||||
if not server_info:
|
if not server_info:
|
||||||
module.fail_json(msg="The instance name provided cannot be found")
|
module.fail_json(msg="The instance name provided cannot be found")
|
||||||
|
|
||||||
fixed_ip, port_id = _get_port_info(quantum, module, server_info['id'])
|
fixed_ip, port_id = _get_port_info(quantum, module, server_info['id'])
|
||||||
if not port_id:
|
if not port_id:
|
||||||
module.fail_json(msg="Cannot find a port for this instance, maybe fixed ip is not assigned")
|
module.fail_json(msg="Cannot find a port for this instance, maybe fixed ip is not assigned")
|
||||||
|
|
||||||
floating_id, floating_ip = _get_floating_ip(module, quantum, fixed_ip)
|
floating_id, floating_ip = _get_floating_ip(module, quantum, fixed_ip)
|
||||||
|
|
||||||
if module.params['state'] == 'present':
|
if module.params['state'] == 'present':
|
||||||
if floating_ip:
|
if floating_ip:
|
||||||
module.exit_json(changed = False, public_ip=floating_ip)
|
module.exit_json(changed = False, public_ip=floating_ip)
|
||||||
|
@ -227,6 +230,7 @@ def main():
|
||||||
if floating_ip:
|
if floating_ip:
|
||||||
_update_floating_ip(quantum, module, None, floating_id)
|
_update_floating_ip(quantum, module, None, floating_id)
|
||||||
module.exit_json(changed=False)
|
module.exit_json(changed=False)
|
||||||
|
|
||||||
# this is magic, see lib/ansible/module.params['common.py
|
# this is magic, see lib/ansible/module.params['common.py
|
||||||
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue