Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not disable SSH agent #1285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/jnpr/junos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,15 +1354,6 @@ def open(self, *vargs, **kvargs):
try:
ts_start = datetime.datetime.now()

# we want to enable the ssh-agent if-and-only-if we are
# not given a password or an ssh key file.
# in this condition it means we want to query the agent
# for available ssh keys

allow_agent = bool(
(self._auth_password is None) and (self._ssh_private_key_file is None)
)

# option to disable ncclient transport ssh authentication
# using public keys look_for_keys=False
if self._look_for_keys is None:
Expand All @@ -1379,7 +1370,6 @@ def open(self, *vargs, **kvargs):
password=self._auth_password,
hostkey_verify=False,
key_filename=self._ssh_private_key_file,
allow_agent=allow_agent,
look_for_keys=look_for_keys,
ssh_config=self._sshconf_lkup(),
timeout=self._conn_open_timeout,
Expand Down
9 changes: 0 additions & 9 deletions lib/jnpr/junos/transport/tty_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ def _ssh_client_pre():
def _tty_open(self):
retry = self.RETRY_OPEN

# we want to enable the ssh-agent if-and-only-if we are
# not given a password or an ssh key file.
# in this condition it means we want to query the agent
# for available ssh keys
allow_agent = bool(
(self.cs_passwd is None) and (self.ssh_private_key_file is None)
)

while retry > 0:
try:
self._ssh_pre.connect(
Expand All @@ -88,7 +80,6 @@ def _tty_open(self):
username=self.cs_user,
password=self.cs_passwd,
timeout=self.timeout,
allow_agent=allow_agent,
look_for_keys=False,
key_filename=self.ssh_private_key_file,
)
Expand Down