summaryrefslogtreecommitdiff
path: root/src/op_mode/neighbor.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-23 20:14:14 +0200
committerChristian Breunig <christian@breunig.cc>2023-08-23 20:18:23 +0200
commitec23c669710a1f98fd1bd2095ffb861007374bda (patch)
tree92bdcf009a1720ea3934b38343e46d832ff975ae /src/op_mode/neighbor.py
parentb88b11ee73601155a485956be80971a697a7f4d6 (diff)
downloadvyos-1x-ec23c669710a1f98fd1bd2095ffb861007374bda.tar.gz
vyos-1x-ec23c669710a1f98fd1bd2095ffb861007374bda.zip
vrf: T5428: move helpers to common vyos.utils.network module
Helper functions can and will be re-use din different code places.
Diffstat (limited to 'src/op_mode/neighbor.py')
-rwxr-xr-xsrc/op_mode/neighbor.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/op_mode/neighbor.py b/src/op_mode/neighbor.py
index 1edeb0045..8b3c45c7c 100755
--- a/src/op_mode/neighbor.py
+++ b/src/op_mode/neighbor.py
@@ -31,14 +31,11 @@ import sys
import typing
import vyos.opmode
+from vyos.utils.network import interface_exists
ArgFamily = typing.Literal['inet', 'inet6']
ArgState = typing.Literal['reachable', 'stale', 'failed', 'permanent']
-def interface_exists(interface):
- import os
- return os.path.exists(f'/sys/class/net/{interface}')
-
def get_raw_data(family, interface=None, state=None):
from json import loads
from vyos.utils.process import cmd