Fixed bug in which every run of loadQueueFile would append to the json file (merge)

cloud-early-config now saves its input file to /var/cache/cloud
Execute load cmd_line.json in update_config
Old way of working still in there to stop and possible clash until the base image is made
This commit is contained in:
Ian Southam 2014-08-13 13:23:24 +02:00 committed by wilderrodrigues
parent 9b40f3d379
commit 98a43d184b
3 changed files with 6 additions and 1 deletions

View File

@ -1491,6 +1491,7 @@ done
echo -e "\n\t}\n}" >> ${CHEF_TMP_FILE}
if [ "$TYPE" != "unknown" ]
then
cp ${CHEF_TMP_FILE} /var/cache/cloud/cmd_line.json
mv ${CHEF_TMP_FILE} /etc/cloudstack/cmd_line.json
fi

View File

@ -1,5 +1,5 @@
from pprint import pprint
def merge(dbag, cmdline):
dbag.setdefault('config', []).append( cmdline )
dbag['config'] = cmdline
return dbag

View File

@ -17,6 +17,10 @@ qf = loadQueueFile()
qf.setFile(sys.argv[1])
qf.load(None)
qf = loadQueueFile()
qf.setFile("cmd_line.json")
qf.load(None)
# Converge
run = subprocess.Popen(["/opt/cloud/bin/configure.py"],
stdout=PIPE, stderr=STDOUT)