mirror of https://github.com/apache/cloudstack.git
Moved processing the cmd_line databag into update
This commit is contained in:
parent
99dd91c565
commit
4e63119873
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue