Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
Implement cli() method, make changes to setup.py in preparation for p…
Browse files Browse the repository at this point in the history
…ushing to GitHub
  • Loading branch information
Gary T. Giesen committed Jun 10, 2020
1 parent 6413bcc commit 84c3c7d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
David Barroso <[email protected]>
Gary T. Giesen <[email protected]>
David Barroso <[email protected]>
35 changes: 35 additions & 0 deletions napalm_dellos6/dellos6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@
from setuptools import setup, find_packages
from pip.req import parse_requirements

__author__ = 'David Barroso <dbarrosop@dravetech.com>'
__author__ = 'Gary T. Giesen <ggiesen@centrilogic.com>'

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,
)

0 comments on commit 84c3c7d

Please sign in to comment.