summaryrefslogtreecommitdiff
path: root/python/vyos/utils/network.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-03 14:33:22 +0200
committerChristian Breunig <christian@breunig.cc>2023-09-03 14:33:22 +0200
commit725b6e0454427b8c2b3a507c61d6192ca7522a7e (patch)
treefa8f84eafe4951d4e5081bbd8462ce5447ccae3f /python/vyos/utils/network.py
parent6ef163baa783c4bbda06493347b845529ae6b3e4 (diff)
downloadveeos-1x-725b6e0454427b8c2b3a507c61d6192ca7522a7e.tar.gz
veeos-1x-725b6e0454427b8c2b3a507c61d6192ca7522a7e.zip
netns: T5241: provide is_netns_interface utility helper
Diffstat (limited to 'python/vyos/utils/network.py')
-rw-r--r--python/vyos/utils/network.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py
index 2f181d8d9..fa86795eb 100644
--- a/python/vyos/utils/network.py
+++ b/python/vyos/utils/network.py
@@ -40,9 +40,9 @@ def interface_exists(interface) -> bool:
import os
return os.path.exists(f'/sys/class/net/{interface}')
-def interface_exists_in_netns(interface_name, netns):
+def is_netns_interface(interface, netns):
from vyos.utils.process import rc_cmd
- rc, out = rc_cmd(f'ip netns exec {netns} ip link show dev {interface_name}')
+ rc, out = rc_cmd(f'ip netns exec {netns} ip link show dev {interface}')
if rc == 0:
return True
return False