Move the order of argument processing

pull/18777/head
Monty Taylor 10 years ago committed by Matt Clay
parent 377311db56
commit 869da89b35

@ -84,18 +84,16 @@ def main():
mutually_exclusive=[['public_key', 'public_key_file']]) mutually_exclusive=[['public_key', 'public_key_file']])
module = AnsibleModule(argument_spec, **module_kwargs) module = AnsibleModule(argument_spec, **module_kwargs)
state = module.params['state']
name = module.params['name']
public_key = module.params['public_key']
if module.params['public_key_file']: if module.params['public_key_file']:
public_key = open(module.params['public_key_file']).read() public_key = open(module.params['public_key_file']).read()
else:
public_key = module.params['public_key']
if not HAS_SHADE: if not HAS_SHADE:
module.fail_json(msg='shade is required for this module') module.fail_json(msg='shade is required for this module')
state = module.params['state']
name = module.params['name']
public_key = module.params['public_key']
try: try:
cloud = shade.openstack_cloud(**module.params) cloud = shade.openstack_cloud(**module.params)

Loading…
Cancel
Save