This Page

The quantum.agent.netns_cleanup_util Module

class quantum.agent.netns_cleanup_util.FakeNetwork(id)

Bases: object

class quantum.agent.netns_cleanup_util.NullDelegate

Bases: object

quantum.agent.netns_cleanup_util.destroy_namespace(conf, namespace, force=False)

Destroy a given namespace.

If force is True, then dhcp (if it exists) will be disabled and all devices will be forcibly removed.

quantum.agent.netns_cleanup_util.eligible_for_deletion(conf, namespace, force=False)

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.

quantum.agent.netns_cleanup_util.kill_dhcp(conf, namespace)

Disable DHCP for a network if DHCP is still active.

quantum.agent.netns_cleanup_util.main()

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 Quantum 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.

quantum.agent.netns_cleanup_util.setup_conf()

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.

quantum.agent.netns_cleanup_util.unplug_device(conf, device)