From 91a748e33be75ab16f8f725e788e5649c436cb46 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 3 Apr 2018 17:01:59 -0400 Subject: [PATCH] fixes issue when netconf would report ios is not supported (#38155) * fixes issue when netconf would report ios is not supported This change now will map ansible_network_os=ios to the correct netconf plugin implementation. This will resolve an error where the netconf connection plugin will report that ios is unsupported. --- lib/ansible/plugins/connection/netconf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/connection/netconf.py b/lib/ansible/plugins/connection/netconf.py index f116af4f0d..e23fbd4402 100644 --- a/lib/ansible/plugins/connection/netconf.py +++ b/lib/ansible/plugins/connection/netconf.py @@ -156,8 +156,9 @@ except ImportError: logging.getLogger('ncclient').setLevel(logging.INFO) -network_os_device_param_map = { - "nxos": "nexus" +NETWORK_OS_DEVICE_PARAM_MAP = { + "nxos": "nexus", + "ios": "default" } @@ -241,7 +242,7 @@ class Connection(ConnectionBase): if network_os: display.display('discovered network_os %s' % network_os, log_only=True) - device_params = {'name': (network_os_device_param_map.get(network_os) or network_os or 'default')} + device_params = {'name': (NETWORK_OS_DEVICE_PARAM_MAP.get(network_os) or network_os or 'default')} ssh_config = os.getenv('ANSIBLE_NETCONF_SSH_CONFIG', False) if ssh_config in BOOLEANS_TRUE: