From 0609b9ded0a657c7029aa80391269efb640b73aa Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Thu, 20 Apr 2017 15:02:42 -0400 Subject: [PATCH] EOS default transport (#23824) * Give a default to eos transport --- lib/ansible/module_utils/eos.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py index a0ae4434a6..8696a51129 100644 --- a/lib/ansible/module_utils/eos.py +++ b/lib/ansible/module_utils/eos.py @@ -54,7 +54,7 @@ eos_argument_spec = { 'timeout': dict(type='int'), 'provider': dict(type='dict'), - 'transport': dict(choices=['cli', 'eapi']) + 'transport': dict(choices=['cli', 'eapi'], default='cli') } # Add argument's default value here @@ -94,9 +94,7 @@ def get_connection(module): global _DEVICE_CONNECTION if not _DEVICE_CONNECTION: load_params(module) - transport = module.params['transport'] - provider_transport = (module.params['provider'] or {}).get('transport') - if 'eapi' in (transport, provider_transport): + if is_eapi(module): conn = Eapi(module) else: conn = Cli(module)