To provide better feedback to the RebootNodeWithPCU() API call:
Stephen Soltesz [Thu, 7 Apr 2011 22:51:55 +0000 (18:51 -0400)]
    - 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.

pcucontrol/models/HPiLO.py
pcucontrol/reboot.py

index 417844d..2037ab7 100644 (file)
@@ -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)
index f7c2810..122edbb 100755 (executable)
@@ -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: