napalm-automation / napalm-ios

Apache License 2.0
31 stars 40 forks source link

get_snmp_information() returns ACL names as "N/A" if none exist for a community #187

Closed bholmgren closed 6 years ago

bholmgren commented 7 years ago

IOS driver returns "N/A" if no ACL is specified for a community statement. This is a different behaviour from EOS and NX-OS that simply return an empty string.

The documentation has an example that includes "N/A" though so while I am not sure which one is the intended behaviour, an empty string or None makes much more sense than "N/A"

$ pip freeze | grep napalm-ios
napalm-ios==0.7.0
mydevice#show running-config | section snmp-server community
snmp-server community public ro
In [1]: from napalm_base import get_network_driver
In [2]: ios=get_network_driver('ios')
In [3]: with ios(hostname='mydevice', username='user', password='password') as device:
    print device.get_snmp_information()['community']
   ...:     
{u'public': {u'mode': u'ro', u'acl': u'N/A'}}
ktbyers commented 7 years ago

Adding @mirceaulinic @dbarrosop...to me the definition in napalm-base is the canonical behavior so this would be an EOS and NX-OS bug.

Alternatively, we can change the definition and just review the drivers...one way or another we should standardize.

mirceaulinic commented 6 years ago

Hi @bholmgren - we are currently in the process of reunification, please check https://napalm-automation.net/reunification/. For the time being, we have moved this issue to https://github.com/napalm-automation/napalm/issues/470 so we can discuss further. Going forward, we'd like to ask you to submit Pull Requests and Issues to the main repository: https://github.com/napalm-automation/napalm

Thanks for understanding!