mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix update_config.py use of subprocess.
This commit is contained in:
parent
5f87bde909
commit
cf4cdde291
@ -4,7 +4,7 @@ import sys
|
|||||||
from merge import loadQueueFile
|
from merge import loadQueueFile
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE, STDOUT
|
||||||
|
|
||||||
logging.basicConfig(filename='/var/log/cloud.log',level=logging.DEBUG, format='%(asctime)s %(message)s')
|
logging.basicConfig(filename='/var/log/cloud.log',level=logging.DEBUG, format='%(asctime)s %(message)s')
|
||||||
|
|
||||||
@ -19,12 +19,12 @@ qf.load(None)
|
|||||||
|
|
||||||
# Converge
|
# Converge
|
||||||
run = subprocess.Popen(["/opt/cloud/bin/configure.py"],
|
run = subprocess.Popen(["/opt/cloud/bin/configure.py"],
|
||||||
stdout=PIPE, stderr=PIPE)
|
stdout=PIPE, stderr=STDOUT)
|
||||||
result = run.wait()
|
stdout, stderr = run.communicate()
|
||||||
|
|
||||||
if (result != 0):
|
if run.returncode:
|
||||||
print run.stderr
|
print stdout
|
||||||
else:
|
else:
|
||||||
print "Convergence is achieved - you have been assimilated!"
|
print "Convergence is achieved - you have been assimilated!"
|
||||||
|
|
||||||
sys.exit(result)
|
sys.exit(run.returncode)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user