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]