Skip to content

Commit

Permalink
Merge pull request #853 from vnitinv/evo-on-box
Browse files Browse the repository at this point in the history
Handle newer junos devices
  • Loading branch information
ydnath committed Aug 2, 2018
2 parents 84a5819 + dfe1240 commit d5e9c39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/jnpr/junos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def _in_path(dir):


class _Connection(object):

ON_JUNOS = platform.system().upper() == 'JUNOS' or \
platform.release().startswith('JNPR')
platform.release().startswith('JNPR') or \
os.path.isfile('/usr/share/cevo/cevo_version')
auto_probe = 0 # default is no auto-probe

# ------------------------------------------------------------------------
Expand Down Expand Up @@ -1248,7 +1248,8 @@ def open(self, *vargs, **kvargs):
key_filename=self._ssh_private_key_file,
allow_agent=allow_agent,
ssh_config=self._sshconf_lkup(),
device_params={'name': 'junos', 'local': False})
device_params={'name': 'junos', 'local':
self.__class__.ON_JUNOS})
self._conn._session.add_listener(DeviceSessionListener(self))
except NcErrors.AuthenticationError as err:
# bad authentication credentials
Expand Down
2 changes: 1 addition & 1 deletion lib/jnpr/junos/transport/tty.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Terminal(object):
'(?P<passwd>assword:\s*$)',
'(?P<badpasswd>ogin incorrect)',
'(?P<netconf_closed><!-- session end at .*-->\s*)',
'(?P<shell>%|#\s*$)',
'(?P<shell>%|#|/$\s*$)',
'(?P<cli>[^\\-"]>\s*$)',
'(?P<option>Enter your option:\s*$)',
'(?P<hotkey>connection: <CTRL>Z)',
Expand Down

0 comments on commit d5e9c39

Please sign in to comment.