From a67845b641d522516f0b79e13f576eae5c4fc65f Mon Sep 17 00:00:00 2001 From: “Manuel Buil” Date: Mon, 13 Feb 2017 15:05:58 +0100 Subject: Fix bugs when setting up computes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JIRA: SFC-71 1 - dev br-int was missing when adding the route 2 - grep exits with 1 when nothing is found triggering an ERROR log even though there was not error Change-Id: Ib65d74d4b01021dcabb5af9068451b97c0170f75 Signed-off-by: “Manuel Buil” --- sfc/lib/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sfc/lib') diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index 2f98f6ff..186cbd91 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -400,8 +400,9 @@ def setup_compute_node(cidr): ip_computes = get_openstack_node_ips("compute") for ip_compute in ip_computes: run_cmd_on_compute("ifconfig br-int up", ip_compute) - if not run_cmd_on_compute("ip route|grep -o %s" % cidr, ip_compute): + if not run_cmd_on_compute( + "ip route|grep -o %s || true" % cidr, ip_compute): logger.info("adding route %s in %s" % (cidr, ip_compute)) - run_cmd_on_compute("ip route add %s" % cidr, ip_compute) + run_cmd_on_compute("ip route add %s dev br-int" % cidr, ip_compute) else: logger.info("route %s exists" % cidr) -- cgit 1.2.3-korg