From: ncode Date: Thu, 21 Jun 2012 10:27:52 +0000 (-0300) Subject: Bug 1015953 - linuxbridge_quantum_agent device_exists() is buggy X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=79d0bd7124be60075e59b4662c7b7315b78c4f4e;p=openstack-build%2Fneutron-build.git Bug 1015953 - linuxbridge_quantum_agent device_exists() is buggy Just added the check_exit_code=False to utils.execute call Change-Id: I3105131e853d45609bc441482bf5b3c3e035a129 --- diff --git a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py b/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py index 064c23dae..4eb262028 100755 --- a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py +++ b/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py @@ -66,12 +66,12 @@ class LinuxBridge: def device_exists(self, device): """Check if ethernet device exists.""" - retval = utils.execute(['ip', 'link', 'show', - 'dev', device], root_helper=self.root_helper) - if retval: - return True - else: + try: + utils.execute(['ip', 'link', 'show', 'dev', device], + root_helper=self.root_helper) + except RuntimeError: return False + return True def get_bridge_name(self, network_id): if not network_id: