calling is actually working

This commit is contained in:
Rafael.Timmerberg 2013-05-30 00:12:34 +02:00
commit fbdbaf419f

View file

@ -27,15 +27,15 @@ class Command:
self.commandStart = dt.now() self.commandStart = dt.now()
self.log.d("calling command " + str(self.command) + " at " + str(self.commandStart)) self.log.d("calling command " + str(self.command) + " at " + str(self.commandStart))
#self.output=sp.check_output(self.command.split()) #self.output=sp.check_output(self.command.split())
process = Popen(stdout=PIPE, *self.command.split()) process = Popen(self.command, stdout=sp.PIPE, stderr=sp.PIPE, shell=True)
self.output, self.error = process.communicate() self.output, self.error = process.communicate()
self.log.d(str(self.output) + str(self.error)) self.log.d(str(self.output))
self.log.d(str(self.error))
self.retcode = process.poll() self.retcode = process.poll()
except CalledProcessError: except CalledProcessError:
self.error=CalledProcessError.output self.error=CalledProcessError.output
self.retcode = CalledProcessError.returncode self.retcode = CalledProcessError.returncode
except Error:
self.log.d("error: " + str(Error))
def getOutput(self): def getOutput(self):
return self.output return self.output