mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Move the order of argument processing
This commit is contained in:
parent
377311db56
commit
869da89b35
1 changed files with 6 additions and 8 deletions
|
@ -84,18 +84,16 @@ def main():
|
|||
mutually_exclusive=[['public_key', 'public_key_file']])
|
||||
module = AnsibleModule(argument_spec, **module_kwargs)
|
||||
|
||||
if module.params['public_key_file']:
|
||||
public_key = open(module.params['public_key_file']).read()
|
||||
else:
|
||||
public_key = module.params['public_key']
|
||||
|
||||
if not HAS_SHADE:
|
||||
module.fail_json(msg='shade is required for this module')
|
||||
|
||||
state = module.params['state']
|
||||
name = module.params['name']
|
||||
public_key = module.params['public_key']
|
||||
|
||||
if module.params['public_key_file']:
|
||||
public_key = open(module.params['public_key_file']).read()
|
||||
|
||||
if not HAS_SHADE:
|
||||
module.fail_json(msg='shade is required for this module')
|
||||
|
||||
try:
|
||||
cloud = shade.openstack_cloud(**module.params)
|
||||
|
||||
|
|
Loading…
Reference in a new issue