X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=reboot.py;h=76cacd3d2fdcad353764d025775afa6ec98f2014;hb=4340c146173732c090d03d4496769fbc89bb986a;hp=c41bac8feb04e97ef91439dbe2408e548a840542;hpb=d5b0651a666c9a6b2deb4103ed15c3c06075395d;p=monitor.git diff --git a/reboot.py b/reboot.py index c41bac8..76cacd3 100755 --- a/reboot.py +++ b/reboot.py @@ -19,6 +19,7 @@ from subprocess import PIPE, Popen import ssh.pxssh as pxssh import ssh.pexpect as pexpect import socket +import moncommands # Use our versions of telnetlib and pyssh sys.path.insert(0, os.path.dirname(sys.argv[0])) @@ -559,9 +560,8 @@ class APC(PCUControl): class IntelAMT(PCUControl): def run(self, node_port, dryrun): - import soltesz - cmd = soltesz.CMD() + cmd = moncommands.CMD() #[cmd_str = "IntelAMTSDK/Samples/RemoteControl/remoteControl" cmd_str = "cmdamt/remoteControl" @@ -625,9 +625,8 @@ class HPiLO(PCUControl): class HPiLOHttps(PCUControl): def run(self, node_port, dryrun): - import soltesz - locfg = soltesz.CMD() + locfg = moncommands.CMD() cmd = "cmdhttps/locfg.pl -s %s -f %s -u %s -p '%s' | grep 'MESSAGE' | grep -v 'No error'" % ( self.host, "iloxml/Get_Network.xml", self.username, self.password) @@ -638,7 +637,7 @@ class HPiLOHttps(PCUControl): return sout.strip() if not dryrun: - locfg = soltesz.CMD() + locfg = moncommands.CMD() cmd = "cmdhttps/locfg.pl -s %s -f %s -u %s -p '%s' | grep 'MESSAGE' | grep -v 'No error'" % ( self.host, "iloxml/Reset_Server.xml", self.username, self.password) @@ -707,7 +706,9 @@ class BayTechCtrlCUnibe(PCUControl): # Control Outlets (5 ,1).........5 try: - index = s.expect(["Enter Request :"]) + print s + print "Enter Request" in s.before + index = s.expect("Enter Request") if index == 0: print "3" @@ -787,7 +788,10 @@ class BayTechCtrlC(PCUControl): print "sending Y" s.send("Y\r\n") - index = s.expect(["DS-RPC>"]) + # NOTE: for some reason, the script times out with the + # following line. In manual tests, it works correctly, but + # with automated tests, evidently it fails. + #index = s.expect(["DS-RPC>"]) #print "got prompt back" s.close() @@ -1163,8 +1167,8 @@ def pcu_name(pcu): else: return None -import soltesz -fb =soltesz.dbLoad("findbadpcus") +import database +fb =database.dbLoad("findbadpcus") def get_pcu_values(pcu_id): # TODO: obviously, this shouldn't be loaded each time...