X-Git-Url: http://git.onelab.eu/?p=pcucontrol.git;a=blobdiff_plain;f=pcucontrol%2Freboot.py;fp=pcucontrol%2Freboot.py;h=eef8d2e2ea094122e00790d60b1622304f948d57;hp=a6e1934a0c41db674339eb28422ef16ab52c9a6a;hb=fec28d68cc164e581c476ee93fd4b4b68ef939fd;hpb=4c1af5526615cf1958b801176c802283d7d4d308 diff --git a/pcucontrol/reboot.py b/pcucontrol/reboot.py index a6e1934..eef8d2e 100755 --- a/pcucontrol/reboot.py +++ b/pcucontrol/reboot.py @@ -88,9 +88,9 @@ class PCUModel(PCU): raise Exception("No such Node ID: %d" % node_id) - def catcherror(self, function, node_port): + def catcherror(self, function, node_port, dryrun): try: - return function(node_port) + return function(node_port, dryrun) except ExceptionNotFound, err: return "Not found: " + str(err) except ExceptionPassword, err: @@ -363,6 +363,7 @@ class BasicPCUControl(PCUModel): cmd = cmd_str + "%s %s %s '%s' %s %s " % ( scriptname, self.host, self.username, self.password, args['dryrun'], args['model']) + print cmd cmd_out, cmd_err = locfg.run_noexcept(cmd) return cmd_out.strip() + cmd_err.strip() @@ -378,7 +379,7 @@ class BasicPCUControl(PCUModel): print "found function %s in model %s" % (looking_for_fxn, self.model) reboot_fxn = getattr(self, looking_for_fxn) - ret = self.catcherror(reboot_fxn, node_port) + ret = self.catcherror(reboot_fxn, node_port, dryrun) return ret