git://git.onelab.eu
/
monitor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9309fc6
)
catch an exception from DRAC logins when the connection is closed early.
author
Stephen Soltesz
<soltesz@cs.princeton.edu>
Thu, 12 Mar 2009 19:33:16 +0000
(19:33 +0000)
committer
Stephen Soltesz
<soltesz@cs.princeton.edu>
Thu, 12 Mar 2009 19:33:16 +0000
(19:33 +0000)
pcucontrol/models/DRAC.py
patch
|
blob
|
history
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: