From 4ac32079279347c454f5d9fe22a21dfcbf3ab64f Mon Sep 17 00:00:00 2001 From: chnm-kulkarni Date: Sat, 30 Jun 2012 09:40:53 +0530 Subject: [PATCH] Cisco's unplug_iface refers to non existing exception Bug #1006226 An extra exception,InvalidDetach has been added to cisco_exception.py and unplug_iface has been redirected to this exception Change-Id: I5d1e4070fd0cb60a973e55e5645509aef58e8083 --- quantum/plugins/cisco/common/cisco_exceptions.py | 6 ++++++ quantum/plugins/cisco/l2network_plugin.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/quantum/plugins/cisco/common/cisco_exceptions.py b/quantum/plugins/cisco/common/cisco_exceptions.py index 149da5d361..2623f745cf 100644 --- a/quantum/plugins/cisco/common/cisco_exceptions.py +++ b/quantum/plugins/cisco/common/cisco_exceptions.py @@ -183,3 +183,9 @@ class InvalidAttach(exceptions.QuantumException): "attachment ID with port ID happens implicitly when " "VM is instantiated; attach operation can be " "performed subsequently.") + + +class InvalidDetach(exceptions.QuantumException): + message = _("Unable to unplug the attachment %(att_id)s from port " + "%(port_id)s for network %(net_id)s. The attachment " + "%(att_id)s does not exist.") diff --git a/quantum/plugins/cisco/l2network_plugin.py b/quantum/plugins/cisco/l2network_plugin.py index ae03ac4396..6c6787b987 100644 --- a/quantum/plugins/cisco/l2network_plugin.py +++ b/quantum/plugins/cisco/l2network_plugin.py @@ -288,8 +288,8 @@ class L2Network(QuantumPluginBase): port = db.port_get(net_id, port_id) attachment_id = port[const.INTERFACEID] if attachment_id is None: - raise exc.InvalidDetach(port_id=port_id, net_id=net_id, - att_id=remote_interface_id) + raise cexc.InvalidDetach(port_id=port_id, net_id=net_id, + att_id=remote_interface_id) self._invoke_device_plugins(self._func_name(), [tenant_id, net_id, port_id]) attachment_id = attachment_id[:const.UUID_LENGTH]