Skip to content

Commit

Permalink
Merge pull request #334 from shermdog/333
Browse files Browse the repository at this point in the history
Fix _auth_user bug
  • Loading branch information
shermdog committed Jan 23, 2015
2 parents d0f0304 + 5b1fce4 commit 9ccf908
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/jnpr/junos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _sshconf_lkup(self):
found = sshconf.lookup(self._hostname)
self._hostname = found.get('hostname', self._hostname)
self._port = found.get('port', self._port)
self._auth_user = found.get('user')
self._conf_auth_user = found.get('user')
self._ssh_private_key_file = found.get('identityfile')
return sshconf_path

Expand Down Expand Up @@ -316,11 +316,12 @@ def __init__(self, *vargs, **kvargs):
self._hostname = hostname
# user will default to $USER
self._auth_user = os.getenv('USER')
self._conf_auth_user = None
# user can get updated by ssh_config
self._ssh_config = kvargs.get('ssh_config')
self._sshconf_path = self._sshconf_lkup()
# but if user is explit from call, then use it.
self._auth_user = kvargs.get('user') or self._auth_user
self._auth_user = kvargs.get('user') or self._conf_auth_user or self._auth_user
self._auth_password = kvargs.get('password') or kvargs.get('passwd')
if not hasattr(self, '_ssh_private_key_file'):
self._ssh_private_key_file = kvargs.get('ssh_private_key_file')
Expand Down
4 changes: 2 additions & 2 deletions lib/jnpr/junos/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "1.1.0"
DATE = "2015-Jan-14"
VERSION = "1.1.1"
DATE = "2015-Jan-22"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setup(
name="junos-eznc",
namespace_packages=['jnpr'],
version="1.1.0",
version="1.1.1",
author="Jeremy Schulman",
author_email="jnpr-community-netdev@juniper.net",
description=("Junos 'EZ' automation for non-programmers"),
Expand Down

0 comments on commit 9ccf908

Please sign in to comment.