0
Ich habe einen Python-Inhalt wie unten, und warum ich Ipmitool Abschlusscode ist 00, aber immer "fehlgeschlagen" zurück?Python-Exit-Code von Subprozess
import subprocess
def sdr(hostname,username,password):
IPMI_SERVER=hostname
IPMI_USERNAME=username
IPMI_PASSWORD=password
p = subprocess.run(["ipmitool.exe", "-H", IPMI_SERVER, "-U", IPMI_USERNAME, "-P", IPMI_PASSWORD, "-I", "lanplus", "raw", "0x06","0x01"], stdout=subprocess.PIPE,stderr=subprocess.PIPE)
#p = subprocess.run(["ipmitool.exe -H 192.168.2.140 -I lanplus -U admin -P admin sdr elist full"], stdout=subprocess.PIPE)
output= p.returncode
return output
if sdr("192.168.2.140","admin","admin"):
print ("successfully")
else:
print ("failed")
Dank es funktioniert ausführen! –