From: Stephen Soltesz Date: Thu, 7 Apr 2011 22:51:55 +0000 (-0400) Subject: To provide better feedback to the RebootNodeWithPCU() API call: X-Git-Tag: pcucontrol-1.0-11~3 X-Git-Url: http://git.onelab.eu/?p=pcucontrol.git;a=commitdiff_plain;h=f6416e374b2387aaa6a0966059aa7ec283bf1f28 To provide better feedback to the RebootNodeWithPCU() API call: - Add more error text to exceptions. - Do not report 'Server being reset' in HPiLO, since this is the desired case and helps return more quickly. --- diff --git a/pcucontrol/models/HPiLO.py b/pcucontrol/models/HPiLO.py index 417844d..2037ab7 100644 --- a/pcucontrol/models/HPiLO.py +++ b/pcucontrol/models/HPiLO.py @@ -63,7 +63,7 @@ class HPiLO(PCUControl): self.username, self.password) cmd_out, cmd_err = locfg.run_noexcept(cmd) - cmd = "grep 'MESSAGE' | grep -v 'No error'" + cmd = "grep 'MESSAGE' | grep -v 'No error' | grep -v 'Server being reset.'" p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) (grep_in, grep_out ) = (p.stdin, p.stdout) diff --git a/pcucontrol/reboot.py b/pcucontrol/reboot.py index f7c2810..122edbb 100755 --- a/pcucontrol/reboot.py +++ b/pcucontrol/reboot.py @@ -120,7 +120,7 @@ class Transport: 443 : HTTPS, 80 : HTTP, 9100 : IPAL, - 623 : IPMI, + 623 : IPMI, 16992 : AMT, } @@ -219,7 +219,7 @@ class Transport: output = self.transport.read_until(expected, self.TELNET_TIMEOUT) if output.find(expected) == -1: print "OUTPUT: --%s--" % output - raise ErrorClass, "'%s' not found" % expected + raise ErrorClass, "'%s' not found: Got: %s" % (expected, output) else: self.transport.write(buffer + "\r\n") else: