def eligible_for_deletion(conf, namespace, force=False):
 if conf.agent_type:
  prefixes = NS_PREFIXES.get(conf.agent_type)
 else:
  prefixes = itertools.chain(*NS_PREFIXES.values())
 ns_mangling_pattern = ('(%s%s)' % ('|'.join(prefixes), constants.UUID_PATTERN))
 if (not re.match(ns_mangling_pattern, namespace)):
  return False
 ip = ip_lib.IPWrapper(namespace=namespace)
 return (force or ip.namespace_is_empty())

def eligible_for_deletion ( conf , namespace , force = False ) : if conf . agent_type : prefixes = NS_PREFIXES . get ( conf . agent_type ) else : prefixes = itertools . chain ( * NS_PREFIXES . values ( ) ) ns_mangling_pattern = ( '(%s%s)' % ( '|' . join ( prefixes ) , constants . UUID_PATTERN ) ) if ( not re . match ( ns_mangling_pattern , namespace ) ) : return False ip = ip_lib . IPWrapper ( namespace = namespace ) return ( force or ip . namespace_is_empty ( ) )
determine whether a namespace is eligible for deletion .