sudo not required explicitly as /bin/ip netns identify is part of READ_ONLY_CMDS in sudoers file (#16258)
Cherry-pick PR :#16115
This commit is contained in:
parent
d19d904f6a
commit
d91565ba5e
@ -157,7 +157,7 @@ def get_current_namespace(pid=None):
|
||||
"""
|
||||
|
||||
net_namespace = None
|
||||
command = ["sudo /bin/ip netns identify {}".format(os.getpid() if not pid else pid)]
|
||||
command = ["/bin/ip netns identify {}".format(os.getpid() if not pid else pid)]
|
||||
proc = subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
shell=True,
|
||||
|
Reference in New Issue
Block a user