diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VRScripts.java b/core/src/com/cloud/agent/resource/virtualnetwork/VRScripts.java index 7821f482c4a..531fbf3a7d9 100644 --- a/core/src/com/cloud/agent/resource/virtualnetwork/VRScripts.java +++ b/core/src/com/cloud/agent/resource/virtualnetwork/VRScripts.java @@ -20,7 +20,7 @@ package com.cloud.agent.resource.virtualnetwork; public class VRScripts { - protected final static String CONFIG_PERSIST_LOCATION = "/etc/cloudstack/"; + protected final static String CONFIG_PERSIST_LOCATION = "/var/cache/cloud/"; protected final static String IP_ASSOCIATION_CONFIG = "ip_associations.json"; protected final static String GUEST_NETWORK_CONFIG = "guest_network.json"; protected final static String NETWORK_ACL_CONFIG = "network_acl.json"; @@ -31,6 +31,7 @@ public class VRScripts { protected static final String VPN_USER_LIST_CONFIG = "vpn_user_list.json"; protected static final String STATICNAT_RULES_CONFIG = "staticnat_rules.json"; protected static final String SITE_2_SITE_VPN_CONFIG = "site_2_site_vpn.json"; + protected static final String STATIC_ROUTES_CONFIG = "static_routes.json"; protected final static String CONFIG_CACHE_LOCATION = "/var/cache/cloud/"; protected final static int DEFAULT_EXECUTEINVR_TIMEOUT = 120; //Seconds diff --git a/systemvm/patches/debian/config/opt/cloud/bin/merge.py b/systemvm/patches/debian/config/opt/cloud/bin/merge.py index b8a53ce2d55..bb6ce3f3618 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/merge.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/merge.py @@ -2,6 +2,7 @@ import json import os +import time import logging import cs_ip import cs_guestnetwork @@ -125,6 +126,8 @@ class loadQueueFile: fileName = '' dpath = "/etc/cloudstack" + configCache = "/var/cache/cloud" + keep = True data = {} def load(self, data): @@ -133,7 +136,7 @@ class loadQueueFile: self.type = self.data["type"] proc = updateDataBag(self) return - fn = self.dpath + '/' + self.fileName + fn = self.configCache + '/' + self.fileName try: handle = open(fn) except IOError: @@ -142,6 +145,10 @@ class loadQueueFile: self.data = json.load(handle) self.type = self.data["type"] handle.close() + if self.keep: + self.__moveFile(fn, self.configCache + "/processed") + else: + os.remove(fn) proc = updateDataBag(self) def setFile(self, name): @@ -156,3 +163,9 @@ class loadQueueFile: def setPath(self, path): self.dpath = path + def __moveFile(self, origPath, path): + if not os.path.exists(path): + os.makedirs(path) + timestamp = str(round(time.time())) + os.rename(origPath, path + "/" + self.fileName + "." + timestamp) +