'Do some preliminary operations before deleting the port.'

def _pre_delete_port(self, context, port_id, port_check):

    LOG.debug('Deleting    port    %s', port_id)
    try:
        kwargs = {'context': context, 'port_id': port_id, 'port_check': port_check}
        registry.notify(resources.PORT, events.BEFORE_DELETE, self, **kwargs)
    except exceptions.CallbackFailure as e:
        if (len(e.errors) == 1):
            raise e.errors[0].error
        raise exc.ServicePortInUse(port_id=port_id, reason=e)
