From 98a43d184b4646e43d88f462cf40cbcce4a88a9a Mon Sep 17 00:00:00 2001 From: Ian Southam Date: Wed, 13 Aug 2014 13:23:24 +0200 Subject: [PATCH] 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 --- systemvm/patches/debian/config/etc/init.d/cloud-early-config | 1 + systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py | 2 +- systemvm/patches/debian/config/opt/cloud/bin/update_config.py | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index 06780aee699..11866602c49 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -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 diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py b/systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py index 6868a454ce7..f37dacf58fd 100644 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs_cmdline.py @@ -1,5 +1,5 @@ from pprint import pprint def merge(dbag, cmdline): - dbag.setdefault('config', []).append( cmdline ) + dbag['config'] = cmdline return dbag diff --git a/systemvm/patches/debian/config/opt/cloud/bin/update_config.py b/systemvm/patches/debian/config/opt/cloud/bin/update_config.py index a198a880c2c..31a6b97d51e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/update_config.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/update_config.py @@ -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)