Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
1fbe4d09
Commit
1fbe4d09
authored
Dec 16, 2013
by
Ilias Tsitsimpis
Browse files
snf-burnin: Retry when SSHException
Retry when `SSHException: Error reading SSH protocol banner'.
parent
faaf1c17
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-tools/synnefo_tools/burnin/cyclades_common.py
View file @
1fbe4d09
...
...
@@ -356,18 +356,19 @@ class CycladesTests(BurninTests):
d_image
=
self
.
clients
.
cyclades
.
get_image_details
(
image
[
'id'
])
return
d_image
[
'metadata'
][
'osfamily'
].
lower
().
find
(
osfamily
)
>=
0
# Method could be a function. pylint: disable-msg=R0201
def
_ssh_execute
(
self
,
hostip
,
username
,
password
,
command
):
"""Execute a command via ssh"""
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
try
:
ssh
.
connect
(
hostip
,
username
=
username
,
password
=
password
)
except
socket
.
error
as
e
rr
:
self
.
fail
(
err
)
try
:
_
,
stdout
,
_
=
ssh
.
exec_command
(
command
)
except
paramiko
.
SSHException
as
err
:
self
.
fail
(
err
)
except
paramiko
.
SSHException
as
e
xcpt
:
if
excpt
.
code
==
104
:
# Error reading SSH protocol banner
raise
Re
try
()
else
:
raise
_
,
stdout
,
_
=
ssh
.
exec_command
(
command
)
status
=
stdout
.
channel
.
recv_exit_status
()
output
=
stdout
.
readlines
()
ssh
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment