From: sysnet Date: Wed, 24 Jul 2013 23:50:04 +0000 (-0400) Subject: Passing the error message as keyword argument X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8f81d21ef144f93a9d4f71624d5c0b8b65a1f4d1;p=openstack-build%2Fneutron-build.git Passing the error message as keyword argument as expected by the base exception class (OpenstackException) which does not accept any positional arguments Fixes: bug #1204321 Change-Id: I320807f6f629fc337a612ad2f9c55ae2c156cfd9 --- diff --git a/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py index 5004e177d..eb5f2636a 100644 --- a/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py +++ b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py @@ -118,7 +118,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("PLUMgrid NOS communication failed") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) # return created network return net @@ -150,7 +150,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("PLUMgrid NOS communication failed") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) # return updated network return new_network @@ -174,7 +174,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("PLUMgrid NOS communication failed") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) def create_port(self, context, port): """Create port core Neutron API.""" @@ -233,7 +233,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("PLUMgrid NOS communication failed: ") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) return subnet @@ -256,7 +256,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("PLUMgrid NOS communication failed: ") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) return del_subnet @@ -288,7 +288,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("PLUMgrid NOS communication failed: ") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) return new_subnet @@ -321,5 +321,5 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): except Exception: err_message = _("Network Admin State Validation Falied: ") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) return network diff --git a/neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py index bc8c53e7b..8e79b3391 100644 --- a/neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py +++ b/neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py @@ -84,7 +84,7 @@ class RestConnection(object): except ValueError: err_message = _("PLUMgrid HTTP Connection Failed: ") LOG.Exception(err_message) - raise plum_excep.PLUMgridException(err_message) + raise plum_excep.PLUMgridException(err_msg=err_message) ret = (resp.status, resp.reason, resp_str) except urllib2.HTTPError: