From 4e6311987345d3c144052dce5f1fa57fdb17b4fe Mon Sep 17 00:00:00 2001 From: Ian Southam Date: Wed, 13 Aug 2014 16:28:12 +0200 Subject: [PATCH] Moved processing the cmd_line databag into update --- .../debian/config/opt/cloud/bin/configure.py | 24 ------------------- .../config/opt/cloud/bin/update_config.py | 7 ++++++ 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/config/opt/cloud/bin/configure.py index 370b6891d67..897d94dc96e 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/configure.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/configure.py @@ -685,36 +685,12 @@ def main(argv): logging.basicConfig(filename='/var/log/cloud.log', level=logging.DEBUG, format='%(asctime)s %(message)s') - - # we need to parse the cmd_line often, cloudstack might change it between reboots - -# TODO - Take this out --------------------------------------------------------------------- # - cmdLine = dataBag() - cmdLine.setKey("cmd_line") - cmdLine.load() - cmdLineData = cmdLine.getDataBag() db = dataBag() db.setKey("ips") db.load() dbag = db.getDataBag() - if not cmdLineData["cmd_line"]["type"] in { "vpcrouter", "router"}: - logging.info("Not equipped to handle %s yet" % cmdLineData["cmd_line"]["type"]) - return - - if cmdLineData["cmd_line"]["type"] == "vpcrouter": - # Create "fake" dev for eth0 - controlIp = dict() - controlIp["add"] = True - controlIp["public_ip"] = cmdLineData["cmd_line"]["eth0ip"] - controlIp["netmask"] = cmdLineData["cmd_line"]["eth0mask"] - controlIp["nic_dev_id"] = 0 - controlIp["nw_type"] = "control" - merge(dbag, controlIp) -# ----------------------------------------------------------------------------------------- # - - for dev in CsDevice('').list(): ip = CsIP(dev) ip.compare(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 a70ecd707e1..b8c4180f2b4 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/update_config.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/update_config.py @@ -21,6 +21,13 @@ if not (os.path.isfile(filePath) and os.access(filePath, os.R_OK)): print "You are telling me to process %s, but i can't access it" % filePath sys.exit(1) +# If the command line json file is unprocessed process it +# This is important or, the control interfaces will get deleted! +if os.path.isfile("filePath/%s" % "cmd_line.json"): + qf = loadQueueFile() + qf.setFile("cmd_line.json") + qf.load(None) + qf = loadQueueFile() qf.setFile(sys.argv[1]) qf.load(None)