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
This commit is contained in:
chnm-kulkarni 2012-06-30 09:40:53 +05:30
parent 681d096ef2
commit 4ac3207927
2 changed files with 8 additions and 2 deletions

View File

@ -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.")

View File

@ -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]