From abe24c27056020f47f14d2bb40ea0f27bede90cc Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 10 Jan 2022 11:56:58 +0100 Subject: [PATCH] Fix privileged create_netns function In the patch [1] create_netns function from the Neutron's privileged ip_lib module was changed in the way that it was implemented in the same way like original pyroute2's create_netns function. Unfortunately during backporing that patch to stable/ussuri and stable/train branches, we probably made mistake and instead of calling pyroute2's private function _netns() we still called public function netns() (which we tried to "reimplement" really). So this patch updates it and changes to use private _netns() function from pyroute2, in the same way like it is done in the branches newer than stable/ussuri. [1] https://review.opendev.org/c/openstack/neutron/+/778735 Related-Bug: #1917487 Change-Id: Id25ca8a67b52393a1c24c9d659189adc9c16a011 --- neutron/privileged/agent/linux/ip_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/privileged/agent/linux/ip_lib.py b/neutron/privileged/agent/linux/ip_lib.py index 81669ad6df9..14e09851192 100644 --- a/neutron/privileged/agent/linux/ip_lib.py +++ b/neutron/privileged/agent/linux/ip_lib.py @@ -534,7 +534,7 @@ def create_netns(name, **kwargs): pid = os.fork() if pid == 0: try: - netns.create(name, libc=_get_cdll()) + netns._create(name, libc=_get_cdll()) except OSError as e: if e.errno != errno.EEXIST: os._exit(1)