git://git.onelab.eu
/
monitor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catch an exception from DRAC logins when the connection is closed early.
[monitor.git]
/
pcucontrol
/
models
/
DRAC.py
diff --git
a/pcucontrol/models/DRAC.py
b/pcucontrol/models/DRAC.py
index
a64a87d
..
e3172b6
100644
(file)
--- a/
pcucontrol/models/DRAC.py
+++ b/
pcucontrol/models/DRAC.py
@@
-12,10
+12,13
@@
class DRAC(PCUControl):
"-o PasswordAuthentication=yes "+\
"-o PubkeyAuthentication=no"
s = pxssh.pxssh()
"-o PasswordAuthentication=yes "+\
"-o PubkeyAuthentication=no"
s = pxssh.pxssh()
- if not s.login(self.host, self.username, self.password, ssh_options,
+ try:
+ if not s.login(self.host, self.username, self.password, ssh_options,
original_prompts="Dell", login_timeout=Transport.TELNET_TIMEOUT):
original_prompts="Dell", login_timeout=Transport.TELNET_TIMEOUT):
- raise ExceptionPassword("Invalid Password")
-
+ raise ExceptionPassword("Invalid Password")
+ except pexpect.EOF:
+ raise ExceptionPrompt("Disconnect before login prompt")
+
print "logging in... %s" % self.host
s.send("\r\n\r\n")
try:
print "logging in... %s" % self.host
s.send("\r\n\r\n")
try: