summaryrefslogtreecommitdiff
path: root/src/conf-mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-01-06 22:41:51 +0100
committerChristian Poessinger <christian@poessinger.com>2018-01-06 22:41:51 +0100
commitfe9e08aacb05fd2ca4e242bae57b7fbecb1640c2 (patch)
tree9d0c894052e29d87086bc6335cb002afe6b664c0 /src/conf-mode
parent52a2f56ec61935c9d54cfd0d011f534046e410d8 (diff)
downloadvyos-1x-fe9e08aacb05fd2ca4e242bae57b7fbecb1640c2.tar.gz
vyos-1x-fe9e08aacb05fd2ca4e242bae57b7fbecb1640c2.zip
mdns-repeater: Remove Python subprocess imports
Diffstat (limited to 'src/conf-mode')
-rwxr-xr-xsrc/conf-mode/vyos-config-mdns-repeater.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/conf-mode/vyos-config-mdns-repeater.py b/src/conf-mode/vyos-config-mdns-repeater.py
index 85e3bb42c..04a17c126 100755
--- a/src/conf-mode/vyos-config-mdns-repeater.py
+++ b/src/conf-mode/vyos-config-mdns-repeater.py
@@ -20,7 +20,6 @@ import sys
import os
import netifaces
import time
-import subprocess
from vyos.config import Config
from vyos.util import ConfigError
@@ -76,16 +75,12 @@ def generate(mdns):
return None
def apply(mdns):
- systemd_cmd = ["sudo", "systemctl"]
-
if len(mdns) == 0:
- systemd_cmd.append("stop")
+ cmd = "sudo systemctl stop mdns-repeater"
else:
- systemd_cmd.append("restart")
-
- systemd_cmd.append("mdns-repeater.service")
+ cmd = "sudo systemctl restart mdns-repeater"
- subprocess.call(systemd_cmd)
+ os.system(cmd)
return None
if __name__ == '__main__':