python: raise child_exception, OSError: [Errno 2] Keine solche Datei oder kein solches Verzeichnis
Ich führe einen Befehl in Python mit der Funktion subprocess.popen () wie folgt aus:
omp_cmd = 'cat %s | omp -h %s -u %s -w %s -p %s -X -' %(temp_xml, self.host_IP, self.username, self.password, self.port)
xmlResult = Popen(omp_cmd, stdout=PIPE, stderr=STDOUT)
In der Shell läuft es einwandfrei, aber in Python bekomme ich:
File "/home/project/vrm/apps/audit/models.py", line 148, in sendOMP
xmlResult = Popen(omp_cmd, stdout=PIPE, stderr=STDOUT)
File "/usr/local/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/local/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Ich habe den Fehler gesucht, aber keiner von ihnen hat mein Problem gelöst. Weiß jemand, was die Ursache für dieses Problem ist? Vielen Dank.