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.
This commit is contained in:
Peter Sprygada 2018-04-03 17:01:59 -04:00 committed by Nathaniel Case
parent 873a9ddf8d
commit 91a748e33b

View file

@ -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: