From 9fe040e96d589f9f4bf2a0f1463ffceb5f47b843 Mon Sep 17 00:00:00 2001 From: Wilder Rodrigues Date: Mon, 5 Oct 2015 11:30:18 +0200 Subject: [PATCH] CLOUDSTACK-8915 - Copy the conntrackd configuration every time _redundant_on() function is called - Also refactored the copy() function under CsHelper.py --- .../patches/debian/config/opt/cloud/bin/cs/CsHelper.py | 7 +------ .../patches/debian/config/opt/cloud/bin/cs/CsRedundant.py | 6 ++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py index 6706d4f7f68..9095558a55f 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsHelper.py @@ -213,12 +213,7 @@ def copy_if_needed(src, dest): """ if os.path.isfile(dest): return - try: - shutil.copy2(src, dest) - except IOError: - logging.Error("Could not copy %s to %s" % (src, dest)) - else: - logging.info("Copied %s to %s" % (src, dest)) + copy(src, dest) def copy(src, dest): """ diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py index dcdadfa42d5..0f71673e307 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py @@ -99,10 +99,12 @@ class CsRedundant(object): CsHelper.copy_if_needed( "%s/%s" % (self.CS_TEMPLATES_DIR, "keepalived.conf.templ"), self.KEEPALIVED_CONF) - CsHelper.copy_if_needed( - "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ"), self.CONNTRACKD_CONF) CsHelper.copy_if_needed( "%s/%s" % (self.CS_TEMPLATES_DIR, "checkrouter.sh.templ"), "/opt/cloud/bin/checkrouter.sh") + #The file is always copied so the RVR doesn't't get the wrong config. + #Concerning the r-VPC, the configuration will be applied in a different manner + CsHelper.copy( + "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ"), self.CONNTRACKD_CONF) CsHelper.execute( 'sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived')