def delete_network(self, context, network_id, hdn_operator_call=False): with db_api.autonested_transaction(): if hdn_operator_call: # the network must be removed from the DB super(HdnNeutronPlugin, self).delete_network(context, network_id) LOG.debug("Network delete operation for %s completed", network_id) return # _get_network returns a sqlalchemy model network = self._get_network(context, network_id) # Set the status of the network as 'PENDING DELETE' network.status = constants.STATUS_PENDING_DELETE hdnlib.notify_network_delete({'id': network_id, 'tenant_id': context.tenant_id}) LOG.debug("Queued request to delete network: %s", network_id)
def delete_network(self, context, network_id, hdn_operator_call=False): with db_api.autonested_transaction(context.session): if hdn_operator_call: # the network must be removed from the DB super(HdnNeutronPlugin, self).delete_network(context, network_id) LOG.debug("Network delete operation for %s completed", network_id) return # _get_network returns a sqlalchemy model network = self._get_network(context, network_id) # Set the status of the network as 'PENDING DELETE' network.status = constants.STATUS_PENDING_DELETE if not hdn_operator_call: # This is not really 'after delete', but the meaning here is that # AFTER_DELETE is the event to trigger at completion of the delete # operation registry.notify('NETWORK', events.AFTER_DELETE, self, tenant_id=context.tenant_id, resource_id=network_id) hdnlib.notify_network_delete({'id': network_id, 'tenant_id': context.tenant_id}) LOG.debug("Queued request to delete network: %s", network_id)