napalm-automation-community / napalm-s350

NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG3xx, SG5xx).
Apache License 2.0
16 stars 13 forks source link

Issue with py23_compat #18

Closed Sislik closed 3 years ago

Sislik commented 3 years ago

Hi,

i have fresh install of netbox, napalm and napalm-s350.

napalm --vendor s350 --user --password hostname --debug 2020-10-24 23:34:27,305 - napalm - DEBUG - Starting napalm's debugging tool 2020-10-24 23:34:27,305 - napalm - DEBUG - Gathering napalm packages 2020-10-24 23:34:27,305 - napalm - DEBUG - napalm-s350==0.2.2 2020-10-24 23:34:27,305 - napalm - DEBUG - napalm==3.2.0 2020-10-24 23:34:27,305 - napalm - DEBUG - get_network_driver - Calling with args: ('s350',), {} 2020-10-24 23:34:27,306 - napalm - DEBUG - get_network_driver - Successful 2020-10-24 23:34:27,306 - napalm - DEBUG - init - Calling with args: (<class 'napalm_s350.s350.S350Driver'>, '10.100.1.165', 'ciscocisco'), {'password': '***', 'timeout': 60, 'optional_args': {}} 2020-10-24 23:34:27,306 - napalm - DEBUG - init - Successful 2020-10-24 23:34:27,306 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7f43519969b0>,), {} 2020-10-24 23:34:27,306 - napalm - DEBUG - open - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7f43519969b0>,), {} 2020-10-24 23:34:33,866 - napalm - DEBUG - open - Successful 2020-10-24 23:34:33,866 - napalm - DEBUG - connection_tests - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7f43519969b0>,), {} 2020-10-24 23:34:33,867 - napalm - DEBUG - get_facts - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7f43519969b0>,), {} 2020-10-24 23:34:43,419 - napalm - ERROR - get_facts - Failed: name 'py23_compat' is not defined

================= Traceback =================

Traceback (most recent call last): File "/usr/local/bin/napalm", line 8, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/napalm/base/clitools/cl_napalm.py", line 308, in main run_tests(args) File "/usr/local/lib/python3.6/site-packages/napalm/base/clitools/cl_napalm.py", line 287, in run_tests call_facts(device) File "/usr/local/lib/python3.6/site-packages/napalm/base/clitools/cl_napalm.py", line 27, in wrapper r = func(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/napalm/base/clitools/cl_napalm.py", line 195, in call_facts facts = device.get_facts() File "/usr/local/lib/python3.6/site-packages/napalm_s350/s350.py", line 247, in get_facts interfaces.append(py23_compat.text_type(interface)) NameError: name 'py23_compat' is not defined

[root@uamknbc01 netbox]# pip show napalm Name: napalm Version: 3.2.0 Summary: Network Automation and Programmability Abstraction Layer with Multivendor support Home-page: https://github.com/napalm-automation/napalm Author: David Barroso, Kirk Byers, Mircea Ulinic Author-email: dbarrosop@dravetech.com, ping@mirceaulinic.net, ktbyers@twb-tech.com License: Apache 2.0 Location: /usr/local/lib/python3.6/site-packages Requires: paramiko, junos-eznc, pyeapi, lxml, scp, textfsm, requests, setuptools, jinja2, netmiko, future, netaddr, ciscoconfparse, pyYAML, cffi Required-by: napalm-s350

[root@uamknbc01 netbox]# pip show napalm-s350 Name: napalm-s350 Version: 0.2.2 Summary: NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG3xx, SG5xx) Home-page: https://github.com/napalm-automation-community/napalm-s350 Author: Jasper Lievisse Adriaanse, Petr Klíma Author-email: j@jasper.la, qaxi@seznam.cz License: Apache 2.0 Location: /usr/local/lib/python3.6/site-packages Requires: netaddr, netmiko, napalm Required-by:

[root@uamknbc01 netbox]# python3 --version Python 3.6.8 [root@uamknbc01 netbox]# python2 --version Python 2.7.17

If i switch to napalm version 2.5.0 and s350 to 0.2.1 all is working fine.

qaxi commented 3 years ago

Thank you for bugreport, it was poorly tested as I am currently bussy on Ansible driver https://github.com/qaxi/ansible-ciscosmb

Tested with `napalm-s350$ python3 --version Python 3.8.6

napalm-s350$ pip show napalm Name: napalm Version: 3.2.0 Summary: Network Automation and Programmability Abstraction Layer with Multivendor support Home-page: https://github.com/napalm-automation/napalm Author: David Barroso, Kirk Byers, Mircea Ulinic Author-email: dbarrosop@dravetech.com, ping@mirceaulinic.net, ktbyers@twb-tech.com License: Apache 2.0 Location: /usr/local/lib/python3.8/dist-packages Requires: netmiko, jinja2, requests, netaddr, pyYAML, junos-eznc, scp, pyeapi, cffi, lxml, paramiko, textfsm, setuptools, ciscoconfparse, future Required-by: napalm-s350 napalm-s350$ ` Bugfix is only part of release 0.2.3 whch is on the way.