Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66C6F18640 for ; Sun, 17 Jan 2016 18:14:14 +0000 (UTC) Received: (qmail 92548 invoked by uid 500); 17 Jan 2016 18:14:13 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 92418 invoked by uid 500); 17 Jan 2016 18:14:13 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 92132 invoked by uid 99); 17 Jan 2016 18:14:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Jan 2016 18:14:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 63025E058E; Sun, 17 Jan 2016 18:14:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: remi@apache.org To: commits@cloudstack.apache.org Date: Sun, 17 Jan 2016 18:14:14 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/9] git commit: updated refs/heads/4.7 to ff89587 CLOUDSTACK-9154 - Returns the guest iterface that is marked as added - Force a restart of keepalived if conntrackd is not running or configuration has changed Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7988f51a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7988f51a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7988f51a Branch: refs/heads/4.7 Commit: 7988f51ac07782ad9b9873c32438fd7cdb24edba Parents: 9be76b3 Author: Wilder Rodrigues Authored: Thu Dec 17 14:20:59 2015 +0100 Committer: Wilder Rodrigues Committed: Tue Dec 22 14:52:05 2015 +0100 ---------------------------------------------------------------------- .../patches/debian/config/opt/cloud/bin/cs/CsAddress.py | 5 ++++- .../debian/config/opt/cloud/bin/cs/CsRedundant.py | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7988f51a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py ---------------------------------------------------------------------- diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py index 24d75e5..d320d0a 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py @@ -52,7 +52,7 @@ class CsAddress(CsDataBag): """ ipr = [] for ip in self.get_ips(): - if ip.is_guest(): + if ip.is_guest() and ip.is_added(): ipr.append(ip) if len(ipr) > 0: return sorted(ipr)[-1] @@ -189,6 +189,9 @@ class CsInterface: if "nw_type" in self.address and self.address['nw_type'] in ['public']: return True return False + + def is_added(self): + return self.get_attr("add") def to_str(self): pprint(self.address) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7988f51a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py ---------------------------------------------------------------------- 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 d853eb9..f975871 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py @@ -108,7 +108,6 @@ class CsRedundant(object): CsHelper.service("keepalived", "stop") return - CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False) CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR) CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False) @@ -148,7 +147,7 @@ class CsRedundant(object): conntrackd_temp_bkp = "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ.bkp") CsHelper.copy(conntrackd_template_conf, conntrackd_temp_bkp) - + conntrackd_tmpl = CsFile(conntrackd_template_conf) conntrackd_tmpl.section("Multicast {", "}", [ "IPv4_address 225.0.0.50\n", @@ -164,10 +163,14 @@ class CsRedundant(object): conntrackd_conf = CsFile(self.CONNTRACKD_CONF) is_equals = conntrackd_tmpl.compare(conntrackd_conf) + + force_keepalived_restart = False proc = CsProcess(['/etc/conntrackd/conntrackd.conf']) - if not proc.find() or not is_equals: + + if not proc.find() and not is_equals: CsHelper.copy(conntrackd_template_conf, self.CONNTRACKD_CONF) CsHelper.service("conntrackd", "restart") + force_keepalived_restart = True # Restore the template file and remove the backup. CsHelper.copy(conntrackd_temp_bkp, conntrackd_template_conf) @@ -185,7 +188,7 @@ class CsRedundant(object): heartbeat_cron.commit() proc = CsProcess(['/usr/sbin/keepalived']) - if not proc.find() or keepalived_conf.is_changed(): + if not proc.find() or keepalived_conf.is_changed() or force_keepalived_restart: keepalived_conf.commit() CsHelper.service("keepalived", "restart")