Eos port default values (#23829)
* Hook port back up for eos cli transport * The default values have moved * Why not have conditional defaults?
This commit is contained in:
parent
0609b9ded0
commit
c9b0026cd0
1 changed files with 6 additions and 4 deletions
|
@ -57,6 +57,7 @@ class ActionModule(_ActionModule):
|
|||
pc.connection = 'network_cli'
|
||||
pc.network_os = 'eos'
|
||||
pc.remote_addr = provider['host'] or self._play_context.remote_addr
|
||||
pc.port = provider['port'] or self._play_context.port or 22
|
||||
pc.remote_user = provider['username'] or self._play_context.connection_user
|
||||
pc.password = provider['password'] or self._play_context.password
|
||||
pc.private_key_file = provider['ssh_keyfile'] or self._play_context.private_key_file
|
||||
|
@ -95,8 +96,12 @@ class ActionModule(_ActionModule):
|
|||
if provider.get('host') is None:
|
||||
provider['host'] = self._play_context.remote_addr
|
||||
|
||||
if provider.get('use_ssl') is None:
|
||||
provider['use_ssl'] = eos_argument_spec['use_ssl']['default']
|
||||
|
||||
if provider.get('port') is None:
|
||||
provider['port'] = eos_argument_spec['port']['default']
|
||||
default_port = 443 if provider['use_ssl'] else 80
|
||||
provider['port'] = self._play_context.port or default_port
|
||||
|
||||
if provider.get('timeout') is None:
|
||||
provider['timeout'] = self._play_context.timeout
|
||||
|
@ -110,9 +115,6 @@ class ActionModule(_ActionModule):
|
|||
if provider.get('authorize') is None:
|
||||
provider['authorize'] = False
|
||||
|
||||
if provider.get('use_ssl') is None:
|
||||
provider['use_ssl'] = eos_argument_spec['use_ssl']['default']
|
||||
|
||||
if provider.get('validate_certs') is None:
|
||||
provider['validate_certs'] = eos_argument_spec['validate_certs']['default']
|
||||
|
||||
|
|
Loading…
Reference in a new issue