Commit 7a76d4e0 by Monty Taylor Committed by Toshio Kuratomi

Remove unneeded required_one_of for openstack

We're being too strict - there is a third possibility, which is that a
user will have defined the OS_* environment variables and expect them to
pass through.

Conflicts:
	lib/ansible/module_utils/openstack.py
	lib/ansible/utils/module_docs_fragments/openstack.py
	v2/ansible/module_utils/openstack.py
parent 8286253c
...@@ -91,9 +91,6 @@ def openstack_full_argument_spec(**kwargs): ...@@ -91,9 +91,6 @@ def openstack_full_argument_spec(**kwargs):
def openstack_module_kwargs(**kwargs): def openstack_module_kwargs(**kwargs):
ret = dict( ret = dict(
required_one_of=[
['cloud', 'auth'],
],
mutually_exclusive=[ mutually_exclusive=[
['auth', 'auth_token'], ['auth', 'auth_token'],
['auth_plugin', 'auth_token'], ['auth_plugin', 'auth_token'],
......
...@@ -32,7 +32,8 @@ options: ...@@ -32,7 +32,8 @@ options:
I(auth_url), I(username), I(password), I(project_name) and any I(auth_url), I(username), I(password), I(project_name) and any
information about domains if the cloud supports them. For other plugins, information about domains if the cloud supports them. For other plugins,
this param will need to contain whatever parameters that auth plugin this param will need to contain whatever parameters that auth plugin
requires. This parameter is not needed if a named cloud is provided. requires. This parameter is not needed if a named cloud is provided or
OpenStack OS_* environment variables are present.
required: false required: false
auth_plugin: auth_plugin:
description: description:
......
...@@ -67,3 +67,35 @@ def openstack_find_nova_addresses(addresses, ext_tag, key_name=None): ...@@ -67,3 +67,35 @@ def openstack_find_nova_addresses(addresses, ext_tag, key_name=None):
ret.append(interface_spec['addr']) ret.append(interface_spec['addr'])
return ret return ret
def openstack_full_argument_spec(**kwargs):
spec = dict(
cloud=dict(default=None),
auth_type=dict(default=None),
auth=dict(default=None),
region_name=dict(default=None),
availability_zone=dict(default=None),
verify=dict(default=True, aliases=['validate_certs']),
cacert=dict(default=None),
cert=dict(default=None),
key=dict(default=None),
wait=dict(default=True, type='bool'),
timeout=dict(default=180, type='int'),
api_timeout=dict(default=None, type='int'),
endpoint_type=dict(
default='public', choices=['public', 'internal', 'admin']
)
)
spec.update(kwargs)
return spec
def openstack_module_kwargs(**kwargs):
ret = {}
for key in ('mutually_exclusive', 'required_together', 'required_one_of'):
if key in kwargs:
if key in ret:
ret[key].extend(kwargs[key])
else:
ret[key] = kwargs[key]
return ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment