Skip to content

Commit

Permalink
iproute: Merge pull request #1260 from svinota/1213-netns-compat
Browse files Browse the repository at this point in the history
iproute: bring NetNS.remove() back

Bug-Url: #1260
Bug-Url: #1213
  • Loading branch information
svinota authored Jan 27, 2025
2 parents 0c05807 + 05884ec commit 3d0d36f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyroute2/iproute/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from functools import partial
from socket import AF_INET, AF_INET6, AF_UNSPEC

from pyroute2 import netns
from pyroute2.common import AF_MPLS, basestring
from pyroute2.config import AF_BRIDGE
from pyroute2.netlink import NLM_F_ACK, NLM_F_DUMP, NLM_F_REQUEST, NLMSG_ERROR
Expand Down Expand Up @@ -2708,6 +2709,10 @@ def __init__(
target=target, netns=netns, flags=flags, libc=libc, groups=groups
)

def remove(self):
self.close()
netns.remove(self.status['netns'])


class ChaoticIPRoute(RTNL_API, ChaoticIPRSocket):
'''
Expand Down

0 comments on commit 3d0d36f

Please sign in to comment.