Skip to content

Commit

Permalink
iproute: bring NetNS.remove() back
Browse files Browse the repository at this point in the history
Bug-Url: #1213
  • Loading branch information
svinota committed Jan 27, 2025
1 parent 0c05807 commit 05884ec
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 05884ec

Please sign in to comment.