def destroy_namespace(conf, namespace, force=False):
 try:
  ip = ip_lib.IPWrapper(namespace=namespace)
  if force:
   kill_dhcp(conf, namespace)
   if ip.netns.exists(namespace):
    try:
     kill_listen_processes(namespace)
    except PidsInNamespaceException:
     LOG.error(_LE('Not all processes were killed in %s'), namespace)
    for device in ip.get_devices(exclude_loopback=True):
     unplug_device(conf, device)
  ip.garbage_collect_namespace()
 except Exception:
  LOG.exception(_LE('Error unable to destroy namespace: %s'), namespace)

def destroy_namespace ( conf , namespace , force = False ) : try : ip = ip_lib . IPWrapper ( namespace = namespace ) if force : kill_dhcp ( conf , namespace ) if ip . netns . exists ( namespace ) : try : kill_listen_processes ( namespace ) except PidsInNamespaceException : LOG . error ( _LE ( 'Not all processes were killed in %s' ) , namespace ) for device in ip . get_devices ( exclude_loopback = True ) : unplug_device ( conf , device ) ip . garbage_collect_namespace ( ) except Exception : LOG . exception ( _LE ( 'Error unable to destroy namespace: %s' ) , namespace )
destroy a given namespace .