projects
/
osm
/
RO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Logging traceback for key injection error in robot tests
[osm/RO.git]
/
RO-plugin
/
osm_ro_plugin
/
vimconn.py
diff --git
a/RO-plugin/osm_ro_plugin/vimconn.py
b/RO-plugin/osm_ro_plugin/vimconn.py
index
50e14fa
..
8b207b1
100644
(file)
--- a/
RO-plugin/osm_ro_plugin/vimconn.py
+++ b/
RO-plugin/osm_ro_plugin/vimconn.py
@@
-33,6
+33,7
@@
from io import StringIO
import logging
import socket
import sys
import logging
import socket
import sys
+import traceback
import warnings
import paramiko
import warnings
import paramiko
@@
-766,32
+767,32
@@
class VimConnector:
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(
- ip_addr, username=user, password=password, pkey=pkey, timeout=
1
0
+ ip_addr, username=user, password=password, pkey=pkey, timeout=
3
0
)
for command in commands:
)
for command in commands:
- (i, o, e) = client.exec_command(command, timeout=
1
0)
+ (i, o, e) = client.exec_command(command, timeout=
3
0)
returncode = o.channel.recv_exit_status()
outerror = e.read()
if returncode != 0:
text = "run_command='{}' Error='{}'".format(command, outerror)
returncode = o.channel.recv_exit_status()
outerror = e.read()
if returncode != 0:
text = "run_command='{}' Error='{}'".format(command, outerror)
+ self.logger.debug(traceback.format_tb(e.__traceback__))
raise VimConnUnexpectedResponse(
"Cannot inject ssh key in VM: '{}'".format(text)
)
raise VimConnUnexpectedResponse(
"Cannot inject ssh key in VM: '{}'".format(text)
)
-
return
except (
socket.error,
paramiko.AuthenticationException,
paramiko.SSHException,
) as message:
return
except (
socket.error,
paramiko.AuthenticationException,
paramiko.SSHException,
) as message:
+ self.logger.debug(traceback.format_exc())
raise VimConnUnexpectedResponse(
"Cannot inject ssh key in VM: '{}' - {}".format(
ip_addr, str(message)
)
)
raise VimConnUnexpectedResponse(
"Cannot inject ssh key in VM: '{}' - {}".format(
ip_addr, str(message)
)
)
-
return
# Optional methods
return
# Optional methods