- if ( DEBUG == 1 ):
- print cmd,
- (f_in, f_out, f_err) = os.popen3(cmd)
- value = f_out.read()
- if value == "":
- raise Exception, f_err.read()
- if ( DEBUG == 1 ):
- print " == %s" % value
- f_out.close()
- f_in.close()
- f_err.close()
- return value
+ return CMD.run(self, cmd)
+
+ def get_file(self, rmt_filename, local_filename=None):
+ if local_filename == None:
+ local_filename = "./"
+ cmd = "scp -B %s %s@%s:%s %s" % (self.__options_to_str(),
+ self.user, self.host,
+ rmt_filename, local_filename)
+ # output :
+ # errors will be on stderr,
+ # success will have a blank stderr...
+ return CMD.run_noexcept(self, cmd)
+
+ def run_noexcept(self, cmd):
+ cmd = "ssh %s %s@%s '%s'" % (self.__options_to_str(),
+ self.user, self.host, cmd)
+ return CMD.run_noexcept(self, cmd)