napalm-automation-community / napalm-onyx Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
output should be in the following format:
{
"<if_name>": {
"description": "<description>",
"is_enabled": true,
"is_up": true,
"last_flapped": -1.0,
"mac_address": "a493.4cc1.67a7",
"speed": 100
}
}
Since NAPALM version 3.0.0 it only supports Python3.6+, https://github.com/napalm-automation/napalm/releases/tag/3.0.0. This means they removed the napalm/base/utils/py23_compat.py etc. in napalm-automation/napalm#1068
Due to this change, the napalm-onyx driver doesn't load anymore:
bash-5.0$ python
Python 3.7.9 (default, Aug 18 2020, 04:02:05)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from napalm import get_network_driver
>>> get_network_driver('onyx')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/napalm/base/__init__.py", line 95, in get_network_driver
raise e
File "/usr/local/lib/python3.7/site-packages/napalm/base/__init__.py", line 86, in get_network_driver
module = importlib.import_module(module_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.7/site-packages/napalm_onyx/__init__.py", line 19, in <module>
from napalm_onyx.onyx_ssh import ONYXSSHDriver
File "/usr/local/lib/python3.7/site-packages/napalm_onyx/onyx_ssh.py", line 40, in <module>
from napalm.base.utils import py23_compat
ImportError: cannot import name 'py23_compat' from 'napalm.base.utils' (/usr/local/lib/python3.7/site-packages/napalm/base/utils/__init__.py)
>>>
Since pip version 20.1 they have changed how they handle the requirements.txt parsing and the current implementation in your setup.py doesn't work anymore. This is similar to many other projects that have used the same method , e.g. pypa/pip#8188 (comment)
# pip -V
pip 20.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
# pip install git+https://github.com/napalm-automation-community/napalm-onyx.git
Collecting git+https://github.com/napalm-automation-community/napalm-onyx.git
Cloning https://github.com/napalm-automation-community/napalm-onyx.git to /tmp/pip-req-build-n1w6tajm
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-n1w6tajm/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-n1w6tajm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-oo0l93vz
cwd: /tmp/pip-req-build-n1w6tajm/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-n1w6tajm/setup.py", line 14, in <module>
reqs = [str(ir.req) for ir in install_reqs]
File "/tmp/pip-req-build-n1w6tajm/setup.py", line 14, in <listcomp>
reqs = [str(ir.req) for ir in install_reqs]
AttributeError: 'ParsedRequirement' object has no attribute 'req'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.