Move networking provider options to subspec (#28894)

* Add EOS provider options as subspec

* Add IOS provider options as subspec

* Add IOS XR provider options as subspec

* Add Junos provider options as subspec

* Add NX-OS provider options as subspec

* Add Vyos provider options as subspec

* Remove password checks from check_args

* Do the same to aireos, aruba, ce, dellos*, & sros, as they work the same way

* VyOS does not support `transport`
This commit is contained in:
Nathaniel Case 2017-09-01 11:53:51 -04:00 committed by GitHub
parent 3334407c71
commit de2096e3d0
14 changed files with 66 additions and 101 deletions

View file

@ -32,7 +32,7 @@ from ansible.module_utils.connection import exec_command
_DEVICE_CONFIGS = {}
vyos_argument_spec = {
vyos_provider_spec = {
'host': dict(),
'port': dict(type='int'),
@ -41,8 +41,11 @@ vyos_argument_spec = {
'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'),
'timeout': dict(type='int'),
'provider': dict(type='dict'),
}
vyos_argument_spec = {
'provider': dict(type='dict', options=vyos_provider_spec),
}
vyos_argument_spec.update(vyos_provider_spec)
def get_argspec():
@ -50,7 +53,6 @@ def get_argspec():
def check_args(module, warnings):
provider = module.params['provider'] or {}
for key in vyos_argument_spec:
if module._name == 'vyos_user':
if key not in ['password', 'provider'] and module.params[key]:
@ -59,11 +61,6 @@ def check_args(module, warnings):
if key != 'provider' and module.params[key]:
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
if provider:
for param in ('password',):
if provider.get(param):
module.no_log_values.update(return_values(provider[param]))
def get_config(module, target='commands'):
cmd = ' '.join(['show configuration', target])