def delete_port(self, context, id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. :returns: None :raises: exception.PortInUse :raises: exception.PortNotFound :raises: exception.NetworkNotFound """ # TODO(salvatore-orlando): pass only actual cluster port, cluster = nvplib.get_port_by_quantum_tag( self.clusters.itervalues(), '*', id) if port is None: raise q_exc.PortNotFound(port_id=id) # TODO(bgh): if this is a bridged network and the lswitch we just got # back will have zero ports after the delete we should garbage collect # the lswitch. nvplib.delete_port(cluster, port) LOG.debug(_("delete_port() completed for tenant: %s"), context.tenant_id) return super(NvpPluginV2, self).delete_port(context, id)
def delete_port(self, tenant_id, netw_id, portw_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. :returns: a mapping sequence with the following signature: {'port-id': uuid representing the deleted port on specified quantum network } :raises: exception.PortInUse :raises: exception.PortNotFound :raises: exception.NetworkNotFound """ if not nvplib.check_tenant(self.controller, netw_id, tenant_id): raise exception.NetworkNotFound(net_id=netw_id) nvplib.delete_port(self.controller, netw_id, portw_id) LOG.debug("delete_port() completed for tenant: %s" % tenant_id) return {"port-id": portw_id}
def delete_port(self, context, id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. :returns: None :raises: exception.PortInUse :raises: exception.PortNotFound :raises: exception.NetworkNotFound """ port, cluster = nvplib.get_port_by_quantum_tag(self.clusters, '*', id) if port is None: raise exception.PortNotFound(port_id=id) # TODO(bgh): if this is a bridged network and the lswitch we just got # back will have zero ports after the delete we should garbage collect # the lswitch. nvplib.delete_port(cluster, port) LOG.debug("delete_port() completed for tenant: %s" % context.tenant_id) return super(NvpPluginV2, self).delete_port(context, id)