Unhardcode the port and protocol on eos EAPI (#23350)

We were hard-coding the protocol, port and validate_certs on
eos EAPI via the action plugin.
Put defaults on the eos_argument_spec and pull those values from it.
This commit is contained in:
Ricardo Carrillo Cruz 2017-04-06 19:18:28 +02:00 committed by GitHub
commit 3537b24742
2 changed files with 11 additions and 14 deletions

View file

@ -95,7 +95,7 @@ class ActionModule(_ActionModule):
provider['host'] = self._play_context.remote_addr
if provider.get('port') is None:
provider['port'] = 443
provider['port'] = eos_argument_spec['port']['default']
if provider.get('timeout') is None:
provider['timeout'] = self._play_context.timeout
@ -110,10 +110,10 @@ class ActionModule(_ActionModule):
provider['authorize'] = False
if provider.get('use_ssl') is None:
provider['use_ssl'] = True
provider['use_ssl'] = eos_argument_spec['use_ssl']['default']
if provider.get('validate_certs') is None:
provider['validate_certs'] = True
provider['validate_certs'] = eos_argument_spec['validate_certs']['default']
self._task.args['provider'] = provider