X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=moncommands.py;h=1b675708b4be6f129e52f03f483baa1e8d4024d0;hb=b548c69db3d1f302b4d0d08377f0231eb3c4fd58;hp=65684c5a5bf73be98debb37a74ca0445baf1b506;hpb=0c544465f528992754d180827af43b5531eb537e;p=monitor.git diff --git a/moncommands.py b/moncommands.py index 65684c5..1b67570 100644 --- a/moncommands.py +++ b/moncommands.py @@ -2,6 +2,7 @@ import os DEBUG= 0 +class ExceptionTimeout(Exception): pass COMMAND_TIMEOUT = 60 ssh_options = { 'StrictHostKeyChecking':'no', 'BatchMode':'yes', @@ -65,16 +66,14 @@ class CMD: o_value = "" e_value = "" - #print "reading from f_out" - if len(lout) > 0: o_value = f_out.read() - #print "reading from f_err" - if len(lerr) > 0: e_value = f_err.read() + o_value = f_out.read() + e_value = f_err.read() #print "striping output" o_value = o_value.strip() e_value = e_value.strip() - #print "OUTPUT", o_value, e_value + #print "OUTPUT -%s-%s-" % (o_value, e_value) #print "closing files" f_out.close()