'Clean up auto allocated resources.'

def _cleanup(self, context, network_id=None, router_id=None, subnets=None):

    if router_id:
        for subnet in (subnets or []):
            ignore_notfound(self.l3_plugin.remove_router_interface, context, router_id, {'subnet_id': subnet['id']})
        ignore_notfound(self.l3_plugin.delete_router, context, router_id)
    if network_id:
        ignore_notfound(self.core_plugin.delete_network, context, network_id)
