Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias alias ImportFrom alias identifier ImportFrom alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Dict Str Str Str ListLoad AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListLoad NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args defaults vararg body Pass decorator_list Return NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore ListLoad Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword ListLoad Str Str Str keyword Call NameLoad Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr keyword NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Dict Str NameLoad keyword Call NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore BinOpMod Str TupleLoad Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Return BoolOpOr NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad TryFinally body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad If NameLoad body Expr Call NameLoad NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body For NameStore Call AttributeLoad NameLoad attr keyword NameLoad body Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr Num For NameStore NameLoad body Expr Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Expr Call NameLoad Expr Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad decorator_list
N/A N/A itertools N/A re N/A time neutron_lib constants oslo_config cfg oslo_log log logging oslo_utils importutils neutron._i18n _ _LE neutron.agent.common config agent_config neutron.agent.common ovs_lib neutron.agent.dhcp config dhcp_config neutron.agent.l3 agent l3_agent neutron.agent.l3 dvr neutron.agent.l3 dvr_fip_ns neutron.agent.linux dhcp neutron.agent.linux external_process neutron.agent.linux interface neutron.agent.linux ip_lib neutron.common config N/A LOG N/A N/A logging getLogger __name__ N/A LB_NS_PREFIX qlbaas- N/A NS_PREFIXES N/A dhcp l3 lbaas N/A N/A dhcp NS_PREFIX N/A N/A l3_agent NS_PREFIX N/A dvr SNAT_NS_PREFIX N/A dvr_fip_ns FIP_NS_PREFIX N/A LB_NS_PREFIX FakeDhcpPlugin N/A object N/A N/A Fake RPC plugin to bypass any RPC calls. __getattribute__ N/A N/A self name N/A N/A fake_method N/A N/A N/A args N/A N/A N/A N/A fake_method N/A N/A setup_conf N/A N/A N/A N/A N/A Setup the cfg for the clean up utility.

    Use separate setup_conf for the utility because there are many options
    from the main config that do not apply during clean-up.
     N/A cli_opts N/A N/A N/A cfg BoolOpt force default False help N/A _ Delete the namespace by removing all devices. N/A N/A cfg StrOpt agent-type choices N/A dhcp l3 lbaas help N/A _ Cleanup resources of a specific agent type only. N/A conf N/A cfg CONF N/A N/A N/A conf register_cli_opts cli_opts N/A N/A N/A agent_config register_interface_driver_opts_helper conf N/A N/A N/A conf register_opts N/A dhcp_config DHCP_AGENT_OPTS N/A N/A N/A conf register_opts N/A dhcp_config DHCP_OPTS N/A N/A N/A conf register_opts N/A dhcp_config DNSMASQ_OPTS N/A N/A N/A conf register_opts N/A interface OPTS N/A conf N/A _get_dhcp_process_monitor N/A N/A config N/A N/A N/A N/A N/A external_process ProcessMonitor config config resource_type dhcp N/A kill_dhcp N/A N/A conf namespace N/A N/A N/A Disable DHCP for a network if DHCP is still active. N/A network_id N/A N/A namespace replace N/A dhcp NS_PREFIX N/A dhcp_driver N/A N/A importutils import_object N/A conf dhcp_driver conf conf process_monitor N/A _get_dhcp_process_monitor conf network N/A N/A dhcp NetModel N/A id network_id plugin N/A FakeDhcpPlugin N/A N/A dhcp_driver active N/A N/A N/A N/A dhcp_driver disable N/A eligible_for_deletion N/A N/A conf namespace force N/A False N/A N/A Determine whether a namespace is eligible for deletion.

    Eligibility is determined by having only the lo device or if force
    is passed as a parameter.
     N/A N/A conf agent_type N/A N/A prefixes N/A N/A NS_PREFIXES get N/A conf agent_type N/A N/A prefixes N/A N/A itertools chain N/A N/A NS_PREFIXES values N/A ns_mangling_pattern N/A (%s%s) N/A N/A N/A | join prefixes N/A constants UUID_PATTERN N/A N/A N/A N/A re match ns_mangling_pattern namespace N/A N/A False N/A ip N/A N/A ip_lib IPWrapper namespace namespace N/A N/A force N/A N/A ip namespace_is_empty N/A unplug_device N/A N/A conf device N/A N/A N/A orig_log_fail_as_error N/A N/A device get_log_fail_as_error N/A N/A N/A device set_log_fail_as_error False N/A N/A N/A N/A N/A N/A N/A N/A device link delete N/A N/A N/A RuntimeError N/A N/A N/A N/A device set_log_fail_as_error orig_log_fail_as_error N/A ovs N/A N/A ovs_lib BaseOVS N/A bridge_name N/A N/A ovs get_bridge_for_iface N/A device name N/A bridge_name N/A N/A bridge N/A N/A ovs_lib OVSBridge bridge_name N/A N/A N/A bridge delete_port N/A device name N/A N/A N/A N/A LOG debug Unable to find bridge for device: %s N/A device name N/A N/A N/A N/A device set_log_fail_as_error orig_log_fail_as_error N/A destroy_namespace N/A N/A conf namespace force N/A False N/A N/A Destroy a given namespace.

    If force is True, then dhcp (if it exists) will be disabled and all
    devices will be forcibly removed.
     N/A N/A N/A ip N/A N/A ip_lib IPWrapper namespace namespace N/A force N/A N/A N/A kill_dhcp conf namespace N/A N/A N/A N/A ip netns exists namespace N/A N/A device N/A N/A ip get_devices exclude_loopback True N/A N/A N/A unplug_device conf device N/A N/A N/A ip garbage_collect_namespace N/A N/A N/A Exception N/A N/A N/A N/A LOG exception N/A _LE Error unable to destroy namespace: %s namespace N/A cleanup_network_namespaces N/A N/A conf N/A N/A N/A candidates N/A ns N/A ns N/A N/A N/A ip_lib IPWrapper get_namespaces N/A eligible_for_deletion conf ns N/A conf force N/A candidates N/A N/A N/A N/A time sleep 2 N/A namespace candidates N/A N/A N/A destroy_namespace conf namespace N/A conf force N/A main N/A N/A N/A N/A N/A Main method for cleaning up network namespaces.

    This method will make two passes checking for namespaces to delete. The
    process will identify candidates, sleep, and call garbage collect. The
    garbage collection will re-verify that the namespace meets the criteria for
    deletion (ie it is empty). The period of sleep and the 2nd pass allow
    time for the namespace state to settle, so that the check prior deletion
    will re-confirm the namespace is empty.

    The utility is designed to clean-up after the forced or unexpected
    termination of Neutron agents.

    The --force flag should only be used as part of the cleanup of a devstack
    installation as it will blindly purge namespaces and their devices. This
    option also kills any lingering DHCP instances.
     N/A conf N/A setup_conf N/A N/A conf N/A N/A N/A config setup_logging N/A N/A cleanup_network_namespaces conf N/A