From 84c3c7de6e571563506cfb549ab1cc35722b1c2a Mon Sep 17 00:00:00 2001 From: "Gary T. Giesen" Date: Wed, 10 Jun 2020 15:53:57 -0400 Subject: [PATCH] Implement cli() method, make changes to setup.py in preparation for pushing to GitHub --- AUTHORS | 3 ++- napalm_dellos6/dellos6.py | 35 +++++++++++++++++++++++++++++++++++ setup.py | 18 ++++++++++-------- 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/AUTHORS b/AUTHORS index 480f86b..c4d9091 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1,2 @@ -David Barroso +Gary T. Giesen +David Barroso \ No newline at end of file diff --git a/napalm_dellos6/dellos6.py b/napalm_dellos6/dellos6.py index 7e9d59c..781ec04 100644 --- a/napalm_dellos6/dellos6.py +++ b/napalm_dellos6/dellos6.py @@ -765,3 +765,38 @@ def get_lldp_neighbors_detail(self, interface=""): } return lldp + + def cli(self, commands): + + """ + Will execute a list of commands and return the output in a dictionary format. + Example:: + { + u'show version and haiku': u'''Hostname: re0.edge01.arn01 + Model: mx480 + Junos: 13.3R6.5 + Help me, Obi-Wan + I just saw Episode Two + You're my only hope + ''', + u'show chassis fan' : u''' + Item Status RPM Measurement + Top Rear Fan OK 3840 Spinning at intermediate-speed + Bottom Rear Fan OK 3840 Spinning at intermediate-speed + Top Middle Fan OK 3900 Spinning at intermediate-speed + Bottom Middle Fan OK 3840 Spinning at intermediate-speed + Top Front Fan OK 3810 Spinning at intermediate-speed + Bottom Front Fan OK 3840 Spinning at intermediate-speed''' + } + """ + + cli_output = dict() + if type(commands) is not list: + raise TypeError("Please enter a valid list of commands!") + + for command in commands: + output = self._send_command(command) + cli_output.setdefault(command, {}) + cli_output[command] = output + + return cli_output \ No newline at end of file diff --git a/setup.py b/setup.py index 74757ca..3938dad 100644 --- a/setup.py +++ b/setup.py @@ -5,27 +5,29 @@ from setuptools import setup, find_packages from pip.req import parse_requirements -__author__ = 'David Barroso ' +__author__ = 'Gary T. Giesen ' install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) reqs = [str(ir.req) for ir in install_reqs] setup( name="napalm-dellos6", - version="0.1.0", + version="0.0.1", packages=find_packages(), - author="David Barroso", - author_email="dbarrosop@dravetech.com", - description="Network Automation and Programmability Abstraction Layer with Multivendor support", + author="Gary T. Giesen", + author_email="ggiesen@centrilogic.com", + description="NAPALM driver for Dell EMC Networking OS6 Operating System", classifiers=[ 'Topic :: Utilities', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], - url="https://github.com/napalm-automation/napalm-dellos6", + url="https://github.com/ggiesen/napalm-dellos6", include_package_data=True, install_requires=reqs, )