summaryrefslogtreecommitdiff
path: root/src/op_mode/igmp-proxy.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-15 20:12:56 +0200
committerChristian Breunig <christian@breunig.cc>2023-07-15 20:13:12 +0200
commit5f77ccf91eb402c548fc91b2e080a4b2b86f4181 (patch)
tree9b926dedc07ef547ad8bbe539f89990249552414 /src/op_mode/igmp-proxy.py
parent9285b9a571ee944daf6f17847a62f115146834a4 (diff)
downloadvyos-1x-5f77ccf91eb402c548fc91b2e080a4b2b86f4181.tar.gz
vyos-1x-5f77ccf91eb402c548fc91b2e080a4b2b86f4181.zip
T5195: vyos.util -> vyos.utils package refactoring part #2
Diffstat (limited to 'src/op_mode/igmp-proxy.py')
-rwxr-xr-xsrc/op_mode/igmp-proxy.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/op_mode/igmp-proxy.py b/src/op_mode/igmp-proxy.py
index a640b0bbf..709e25915 100755
--- a/src/op_mode/igmp-proxy.py
+++ b/src/op_mode/igmp-proxy.py
@@ -28,17 +28,14 @@ import tabulate
import vyos.config
import vyos.opmode
-from vyos.util import bytes_to_human
+from vyos.utils.convert import bytes_to_human
from vyos.utils.io import print_error
+from vyos.utils.process import process_named_running
def _is_configured():
"""Check if IGMP proxy is configured"""
return vyos.config.Config().exists_effective('protocols igmp-proxy')
-def _is_running():
- """Check if IGMP proxy is currently running"""
- return not vyos.util.run('ps -C igmpproxy')
-
def _kernel_to_ip(addr):
"""
Convert any given address from Linux kernel to a proper, IPv4 address
@@ -85,7 +82,7 @@ def show_interface(raw: bool):
if not _is_configured():
print_error('IGMP proxy is not configured.')
sys.exit(0)
-if not _is_running():
+if not process_named_running('igmpproxy'):
print_error('IGMP proxy is not running.')
sys.exit(0)