From 1339a4516f2efedaa110350c1ef7ea257a50f18f Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 18 Jan 2016 13:32:33 +0000 Subject: [PATCH] don't catch ProcessExecutionError exception as special case When plugging / unplugging vifs we should not be assuming that the plugin will be running external commands - it could easily be calling other python libraries to do its work. Thus we should not catch ProcessExecutionError as a special case, but instead handle any type of exception Change-Id: Ic03279f6bb6de4bd72dfee7c117cf8502decfec5 --- os_vif/__init__.py | 5 ++--- requirements.txt | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/os_vif/__init__.py b/os_vif/__init__.py index 7ccb188e..de79de91 100644 --- a/os_vif/__init__.py +++ b/os_vif/__init__.py @@ -10,7 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_concurrency import processutils from oslo_log import log as logging from stevedore import extension @@ -95,7 +94,7 @@ def plug(vif, instance): LOG.debug("Plugging vif %s", vif) plugin.plug(vif, instance) LOG.info(_LI("Successfully plugged vif %s"), vif) - except processutils.ProcessExecutionError as err: + except Exception as err: LOG.error(_LE("Failed to plug vif %(vif)s. Got error: %(err)s"), vif=vif, err=err) raise os_vif.exception.PlugException(vif=vif, err=err) @@ -127,7 +126,7 @@ def unplug(vif): LOG.debug("Unplugging vif %s", vif) plugin.unplug(vif) LOG.info(_LI("Successfully unplugged vif %s"), vif) - except processutils.ProcessExecutionError as err: + except Exception as err: LOG.error(_LE("Failed to unplug vif %(vif)s. Got error: %(err)s"), vif=vif, err=err) raise os_vif.exception.UnplugException(vif=vif, err=err) diff --git a/requirements.txt b/requirements.txt index 32f43704..770a6a03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ pbr>=1.6 netaddr>=0.7.12,!=0.7.16 -oslo.concurrency>=2.3.0 # Apache-2.0 oslo.log>=1.14.0 # Apache-2.0 oslo.i18n>=1.5.0 # Apache-2.0 oslo.versionedobjects>=0.13.0