From a7574067921d1a69f186c9328a96e8ebe8c2bdfa Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Sun, 24 Feb 2013 10:30:08 +0000 Subject: [PATCH] Enabled add gateway to refrain from checking exit code Fixes bug 1129741 Change-Id: Ibb9a0e1c0f0e5ad610c4f45ae65eb82e25a57b94 --- quantum/agent/linux/ip_lib.py | 2 +- quantum/tests/unit/test_linux_ip_lib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/agent/linux/ip_lib.py b/quantum/agent/linux/ip_lib.py index 4065b44fff..31337087e6 100644 --- a/quantum/agent/linux/ip_lib.py +++ b/quantum/agent/linux/ip_lib.py @@ -297,7 +297,7 @@ class IpRouteCommand(IpDeviceCommandBase): COMMAND = 'route' def add_gateway(self, gateway, metric=None): - args = ['add', 'default', 'via', gateway] + args = ['replace', 'default', 'via', gateway] if metric: args += ['metric', metric] args += ['dev', self.name] diff --git a/quantum/tests/unit/test_linux_ip_lib.py b/quantum/tests/unit/test_linux_ip_lib.py index f4a67dec13..cc54ff23cd 100644 --- a/quantum/tests/unit/test_linux_ip_lib.py +++ b/quantum/tests/unit/test_linux_ip_lib.py @@ -548,7 +548,7 @@ class TestIpRouteCommand(TestIPCmdBase): metric = 100 self.route_cmd.add_gateway(gateway, metric) self._assert_sudo([], - ('add', 'default', 'via', gateway, + ('replace', 'default', 'via', gateway, 'metric', metric, 'dev', self.parent.name))