Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pyroute2.NetNS] Not honoring flags since pyroute2>0.8.1 #1226

Open
karelyatin opened this issue Dec 30, 2024 · 0 comments
Open

[pyroute2.NetNS] Not honoring flags since pyroute2>0.8.1 #1226

karelyatin opened this issue Dec 30, 2024 · 0 comments
Labels

Comments

@karelyatin
Copy link

karelyatin commented Dec 30, 2024

In OpenStack neutron we have a periodic job running with pyroute2 master(currently at commit e106ce4) and since the merge of thread-unsafe branch in master the job started to fail https://bugs.launchpad.net/neutron/+bug/2092722 as the tests expects the namespace to not be created when flags=0 is passed.

The failure is related to NetNS not honoring flags(like 0 to not create netns)

Reproducer:-
import pyroute2
from pyroute2 import netns
try:
pyroute2.NetNS('netns-test', flags=0)
print("Namespace created")
except FileNotFoundError:
print("Namespace do not exist, creating...")
pyroute2.NetNS('netns-test', flags=64)
print("Removing namespace")
netns.remove('netns-test')

With master branch it do not honor flags=0 and creates the network namespace.
Namespace created
Removing namespace

With 0.8.1 it do not create network namespace if flags=0 is passed
Namespace do not exist, creating...
Removing namespace

@svinota svinota added the bug label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants