Skip to content

Commit

Permalink
Fix revert-resume Authentication Error
Browse files Browse the repository at this point in the history
When we get private keys from the master node
there are two keys '/root/.ssh/id_rsa' and
 '/root/.ssh/bootstrap.rsa'.
An error occures when we try to use a wrong key,
but on the next iteration we use right one
and authentication passes.
So it's just cosmetic defect and patch fixes an exception
mechanism.

Change-Id: If167abc34f1c4060ab3b791204dc7245d06805d9
Closes-Bug: 1494856
  • Loading branch information
akurenyshevmirantis committed Sep 15, 2015
1 parent f665896 commit 2461c7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devops/helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,11 @@ def connect(self):
return self._ssh.connect(
self.host, port=self.port, username=self.username,
password=self.password, pkey=private_key)
except paramiko.AuthenticationException as e:
logging.error("Authentication failed")
logging.exception(e)
except paramiko.AuthenticationException:
continue
if self.private_keys:
logging.error("Authentication with keys failed")

return self._ssh.connect(
self.host, port=self.port, username=self.username,
password=self.password)
Expand Down

0 comments on commit 2461c7e

Please sign in to comment.