@utils.arg('project_id', metavar='<project_id>', help=_('The ID of the project.'))
@deprecated_network
def do_scrub(cs, args):
 networks_list = cs.networks.list()
 networks_list = [network for network in networks_list if (getattr(network, 'project_id', '') == args.project_id)]
 search_opts = {'all_tenants': 1}
 groups = cs.security_groups.list(search_opts)
 groups = [group for group in groups if (group.tenant_id == args.project_id)]
 for network in networks_list:
  cs.networks.disassociate(network)
 for group in groups:
  cs.security_groups.delete(group)

@ utils . arg ( 'project_id' , metavar = '<project_id>' , help = _ ( 'The ID of the project.' ) ) @ deprecated_network def do_scrub ( cs , args ) : networks_list = cs . networks . list ( ) networks_list = [ network for network in networks_list if ( getattr ( network , 'project_id' , '' ) == args . project_id ) ] search_opts = { 'all_tenants' : 1 } groups = cs . security_groups . list ( search_opts ) groups = [ group for group in groups if ( group . tenant_id == args . project_id ) ] for network in networks_list : cs . networks . disassociate ( network ) for group in groups : cs . security_groups . delete ( group )
delete networks and security groups associated with a project .