This change defines the contextmanager in_namespace[1]. It moves current
process in a network namespace (in __enter__) and moves it back in its
original network namespace (in _exit__) or kills current process if
__exit__ fails in order to ensure following commands will be executed
in the correct network namespace.
This change is an enabler to the Netlink solution to clean conntrack
entries.
[1] neutron_fwaas.privileged.utils
Partial-Bug: #1664294
Change-Id: I587257db8e1fce56a95f0db3dc4e0752751fdd81
(cherry picked from commit 094d2d5f01914fbebd4e16cc2c41390a72b5874d)
Reviewed: https:/ /review. openstack. org/458435 /git.openstack. org/cgit/ openstack/ neutron- fwaas/commit/ ?id=a08e30539a3 4f8ec20ab807ea1 630d99d7adfb4e
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit a08e30539a34f8e c20ab807ea1630d 99d7adfb4e
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 14 13:36:02 2017 +0100
Define in_namespace contextmanager
This change defines the contextmanager in_namespace[1]. It moves current
process in a network namespace (in __enter__) and moves it back in its
original network namespace (in _exit__) or kills current process if
__exit__ fails in order to ensure following commands will be executed
in the correct network namespace.
This change is an enabler to the Netlink solution to clean conntrack
entries.
[1] neutron_ fwaas.privilege d.utils
Partial-Bug: #1664294 56a95f0db3dc4e0 752751fdd81 ebd4e16cc2c4139 0a72b5874d)
Change-Id: I587257db8e1fce
(cherry picked from commit 094d2d5f01914fb