Skip to content

Commit

Permalink
Add support for detecting OPX device type. (#36)
Browse files Browse the repository at this point in the history
* Add support for detecting OPX device type.
  • Loading branch information
bobbywatson3 committed Nov 28, 2017
1 parent b5c96ca commit 3e84c05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pylib/aeon/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ def get_device(target=None, user='admin', passwd='admin', nos_only=False):

if i == 2 or i == 3:
session.sendline('cat /proc/version')
i = session.expect(['cumulus', 'Ubuntu', 'Red Hat'], timeout=10)
i = session.expect(['cumulus', 'Ubuntu', 'Red Hat', pexpect.TIMEOUT], timeout=5)
if i == 0:
nos = 'cumulus'
if i == 1:
nos = 'ubuntu'
if i == 2:
nos = 'centos'
if i == 3:
session.sendline('[ -f /etc/opx/opx-environment.sh ] && echo "device is OPX" || echo "Not found"')
i = session.expect(['Not found', 'device is OPX', pexpect.TIMEOUT], timeout=5)
if i == 0 or i == 2:
raise TargetError('Unable to determine device type for %s' % target)
if i == 1:
nos = 'opx'
if i == 4:
raise TargetError('Unable to determine device type for %s' % target)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def requirements(filename):

setup(
name="aeon-venos",
version="0.9.7",
version="0.9.8",
author="Jeremy Schulman",
url='https://github.com/Apstra/aeon-venos',
author_email="jeremy@apstra.com",
Expand Down

0 comments on commit 3e84c05

Please sign in to comment.