diff options
author | Christian Poessinger <christian@poessinger.com> | 2018-01-06 22:41:51 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2018-01-06 22:41:51 +0100 |
commit | fe9e08aacb05fd2ca4e242bae57b7fbecb1640c2 (patch) | |
tree | 9d0c894052e29d87086bc6335cb002afe6b664c0 /src | |
parent | 52a2f56ec61935c9d54cfd0d011f534046e410d8 (diff) | |
download | vyos-1x-fe9e08aacb05fd2ca4e242bae57b7fbecb1640c2.tar.gz vyos-1x-fe9e08aacb05fd2ca4e242bae57b7fbecb1640c2.zip |
mdns-repeater: Remove Python subprocess imports
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf-mode/vyos-config-mdns-repeater.py | 11 |
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__': |