Skip to content

Commit

Permalink
fixes issue when netconf would report ios is not supported (ansible#3…
Browse files Browse the repository at this point in the history
…8155)

* 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.

(cherry picked from commit 91a748e)
  • Loading branch information
privateip authored and Qalthos committed Apr 3, 2018
1 parent f629825 commit 357ec3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ansible/plugins/connection/netconf.py
Expand Up @@ -157,8 +157,9 @@

logging.getLogger('ncclient').setLevel(logging.INFO)

network_os_device_param_map = {
"nxos": "nexus"
NETWORK_OS_DEVICE_PARAM_MAP = {
"nxos": "nexus",
"ios": "default"
}


Expand Down Expand Up @@ -242,7 +243,7 @@ def _connect(self):
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:
Expand Down

0 comments on commit 357ec3b

Please sign in to comment.