Just installed pynos, thought I'd take a look at toying around with it and our VDX switches, but the version in pip today doesn't match what's in this GitHub repo.
$ pip install pynos
Collecting pynos
Downloading pynos-1.3.27.tar.gz (1.6MB)
...
Building wheels for collected packages: pynos, ncclient, ipaddress, pycparser
Running setup.py bdist_wheel for pynos ... done
Stored in directory: /home/username/.cache/pip/wheels/ce/4b/33/b32920a0101f9ef723fc7581050b4892e199758ec36048c54c
Running setup.py bdist_wheel for ncclient ... done
Stored in directory: /home/username/.cache/pip/wheels/8a/e7/91/a9f6e361c834cc1be1e9d80088781ce3797bdb8cf5802ffe95
Running setup.py bdist_wheel for ipaddress ... done
Stored in directory: /home/username/.cache/pip/wheels/d7/6b/69/666188e8101897abb2e115d408d139a372bdf6bfa7abb5aef5
Running setup.py bdist_wheel for pycparser ... done
Stored in directory: /home/username/.cache/pip/wheels/95/14/9a/5e7b9024459d2a6600aaa64e0ba485325aff7a9ac7489db1b6
Successfully built pynos ncclient ipaddress pycparser
Installing collected packages: setuptools, six, pycparser, cffi, pynacl, enum34, idna, asn1crypto, ipaddress, cryptography, bcrypt, pyasn1, paramiko, lxml, ncclient, pynos
Successfully installed asn1crypto bcrypt cffi cryptography enum34 idna ipaddress lxml ncclient paramiko pyasn1 pycparser pynacl pynos setuptools-20.7.0 six
$ python2
Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pprint import pprint
>>> import pynos.device
>>> conn = ('10.0.0.2', '22')
>>> auth = ('username', 'password')
>>> dev = pynos.device.Device(conn=conn, auth=auth)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/username/.local/lib/python2.7/site-packages/pynos/device.py", line 212, in __init__
setattr(self, nos_attr, VERSIONS[ver][nos_attr](self._callback))
KeyError: 'vcenter'
$ wget https://github.com/BRCDcomm/pynos/raw/master/pynos/device.py
--2018-01-05 16:53:42-- https://github.com/BRCDcomm/pynos/raw/master/pynos/device.py
...
2018-01-05 16:53:43 (29.7 MB/s) - ‘device.py’ saved [15765/15765]
$ diff -u device.py /home/username/.local/lib/python2.7/site-packages/pynos/device.py
--- device.py 2018-01-05 16:53:43.729748800 -0800
+++ /home/username/.local/lib/python2.7/site-packages/pynos/device.py 2018-01-05 15:49:27.030597000 -0800
@@ -46,7 +46,9 @@
import pynos.versions.ver_7.ver_7_0_0.lldp
import pynos.versions.ver_7.ver_7_0_0.firmware
import pynos.versions.ver_7.ver_7_1_0.system
-
+import pynos.versions.ver_7.ver_7_1_0.nsx
+import pynos.versions.ver_7.ver_7_1_0.hw_vtep
+import pynos.versions.ver_7.ver_7_1_0.vcenter
VERSIONS = {
'5.0.1': {
'bgp': pynos.versions.ver_5.ver_5_0_1.bgp.BGP,
@@ -112,6 +114,9 @@
'vcs': pynos.versions.ver_6.ver_6_0_1.vcs.VCS,
'firmware': pynos.versions.ver_7.ver_7_0_0.firmware.Firmware,
'ras': pynos.versions.ver_6.ver_6_0_1.ras.RAS,
+ 'nsx': pynos.versions.ver_7.ver_7_1_0.nsx.Nsx,
+ 'hw_vtep': pynos.versions.ver_7.ver_7_1_0.hw_vtep.hwvtep,
+ 'vcenter': pynos.versions.ver_7.ver_7_1_0.vcenter.Vcenter
},
'7.1.0': {
'bgp': pynos.versions.ver_7.ver_7_0_0.bgp.BGP,
@@ -125,11 +130,14 @@
'vcs': pynos.versions.ver_6.ver_6_0_1.vcs.VCS,
'firmware': pynos.versions.ver_7.ver_7_0_0.firmware.Firmware,
'ras': pynos.versions.ver_6.ver_6_0_1.ras.RAS,
+ 'nsx': pynos.versions.ver_7.ver_7_1_0.nsx.Nsx,
+ 'hw_vtep': pynos.versions.ver_7.ver_7_1_0.hw_vtep.hwvtep,
+ 'vcenter': pynos.versions.ver_7.ver_7_1_0.vcenter.Vcenter
}
}
NOS_ATTRS = ['bgp', 'snmp', 'interface', 'lldp', 'system', 'services',
- 'fabric_service', 'vcs', 'firmware', 'ras']
+ 'fabric_service', 'vcs', 'firmware', 'ras', 'vcenter', 'hw_vtep', 'nsx']
class DeviceCommError(Exception):
$
So, I can overwrite everything in ~/.local/lib/python2.7/site-packages/pynos/ with what's in this repo to get it to work, but that stuff should probably be pushed to pip if the readme says to install pynos from pip.
Just installed pynos, thought I'd take a look at toying around with it and our VDX switches, but the version in pip today doesn't match what's in this GitHub repo.
...
...
So, I can overwrite everything in
~/.local/lib/python2.7/site-packages/pynos/with what's in this repo to get it to work, but that stuff should probably be pushed to pip if the readme says to install pynos from pip.