From 79d0bd7124be60075e59b4662c7b7315b78c4f4e Mon Sep 17 00:00:00 2001 From: ncode Date: Thu, 21 Jun 2012 07:27:52 -0300 Subject: [PATCH] Bug 1015953 - linuxbridge_quantum_agent device_exists() is buggy Just added the check_exit_code=False to utils.execute call Change-Id: I3105131e853d45609bc441482bf5b3c3e035a129 --- .../linuxbridge/agent/linuxbridge_quantum_agent.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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: -- 2.45.2