From 57b6110f13d684369550266b93274722ac62de40 Mon Sep 17 00:00:00 2001 From: Pieprzycki Piotr Date: Thu, 14 Feb 2019 07:03:57 +0100 Subject: [PATCH 1/3] fix pip issue --- README.md | 9 +++++++++ setup.py | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01be396..0de2c7f 100644 --- a/README.md +++ b/README.md @@ -99,3 +99,12 @@ Notes * The NAPALM-vyos driver supports authentication with ssh key. Please specify path to a key in optional_args `'optional_args': {'key_file': '/home/user/ssh_private_key'}` + +Configuration Examples +---------------------- +* Vyos as IPSec VPN endpoint and BGP router - https://github.com/DreamLab/ansible-vyos +* CI Demo for vyos+junos (Polish only) https://github.com/ppieprzycki/plnog2016 + +VyOS Community +------------------ +Slack Channel https://slack.vyos.io \ No newline at end of file diff --git a/setup.py b/setup.py index ce58990..fe85bf1 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,12 @@ import uuid from setuptools import setup, find_packages -from pip.req import parse_requirements + +# for pip >= 10 +try: + from pip._internal.req import parse_requirements +except ImportError: + from pip.req import parse_requirements __author__ = 'Piotr Pieprzycki ' @@ -12,7 +17,7 @@ setup( name="napalm-vyos", - version="0.1.5", + version="0.1.6", packages=find_packages(), author="Piotr Pieprzycki", author_email="piotr.pieprzycki@dreamlab.pl", From 42953c84ae98c77fcde005544b281079c43be151 Mon Sep 17 00:00:00 2001 From: Pieprzycki Piotr Date: Thu, 14 Feb 2019 23:43:56 +0100 Subject: [PATCH 2/3] add additional parameters --- napalm_vyos/vyos.py | 12 ++++++++++-- setup.py | 27 +++++++++++++-------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/napalm_vyos/vyos.py b/napalm_vyos/vyos.py index d6560ba..9a6c35c 100644 --- a/napalm_vyos/vyos.py +++ b/napalm_vyos/vyos.py @@ -204,7 +204,10 @@ def compare_config(self): diff = ''.join(output_compare.splitlines(True)[1:-1]) return diff - def commit_config(self): + def commit_config(self, confirmed=None): + if confirmed is not None: + raise NotImplementedError + try: self.device.commit() except ValueError: @@ -358,7 +361,7 @@ def _get_value(key, target_dict): else: return None - def get_arp_table(self): + def get_arp_table(self, vrf=""): # 'age' is not implemented yet """ @@ -370,6 +373,11 @@ def get_arp_table(self): 10.129.2.97 ether 00:50:56:9f:64:09 C eth0 192.168.1.3 ether 00:50:56:86:7b:06 C eth1 """ + + if vrf: + msg = "VRF support has not been added for this getter on this platform." + raise NotImplementedError(msg) + output = self.device.send_command("show arp") output = output.split("\n") diff --git a/setup.py b/setup.py index fe85bf1..bf90a64 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,13 @@ """setup.py file.""" -import uuid - from setuptools import setup, find_packages -# for pip >= 10 -try: - from pip._internal.req import parse_requirements -except ImportError: - from pip.req import parse_requirements +with open("requirements.txt", "r") as fs: + reqs = [r for r in fs.read().splitlines() + if (len(r) > 0 and not r.startswith("#"))] __author__ = 'Piotr Pieprzycki ' -install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) -reqs = [str(ir.req) for ir in install_reqs] setup( name="napalm-vyos", @@ -24,12 +18,17 @@ description="Network Automation and Programmability Abstraction Layer with Multivendor support", classifiers=[ 'Topic :: Utilities', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Operating System :: POSIX :: Linux', - 'Operating System :: MacOS', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Operating System :: POSIX :: Linux', + 'Operating System :: MacOS', ], + url="https://github.com/napalm-automation-community/napalm-vyos", include_package_data=True, install_requires=reqs, ) From 0175531bbb19580db07a8701dd5aa77146d0f156 Mon Sep 17 00:00:00 2001 From: Pieprzycki Piotr Date: Thu, 14 Feb 2019 23:55:18 +0100 Subject: [PATCH 3/3] add additional parameters --- napalm_vyos/vyos.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/napalm_vyos/vyos.py b/napalm_vyos/vyos.py index 9a6c35c..c2d87d8 100644 --- a/napalm_vyos/vyos.py +++ b/napalm_vyos/vyos.py @@ -204,9 +204,11 @@ def compare_config(self): diff = ''.join(output_compare.splitlines(True)[1:-1]) return diff - def commit_config(self, confirmed=None): - if confirmed is not None: - raise NotImplementedError + def commit_config(self, message=""): + if message: + raise NotImplementedError( + "Commit message not implemented for this platform" + ) try: self.device.commit() @@ -374,9 +376,10 @@ def get_arp_table(self, vrf=""): 192.168.1.3 ether 00:50:56:86:7b:06 C eth1 """ - if vrf: - msg = "VRF support has not been added for this getter on this platform." - raise NotImplementedError(msg) + if vrf: + raise NotImplementedError( + "VRF support has not been added for this getter on this platform." + ) output = self.device.send_command("show arp") output = output.split("\n")