introduce disabled services into the systemd stage

This commit is contained in:
Martin Sehnoutka 2019-07-08 14:58:30 +02:00 committed by Lars Karlitski
parent e9fb1ded15
commit 9ea6150ee7

View file

@ -1,16 +1,23 @@
#!/usr/bin/python3
import json
import os
import subprocess
import sys
def main(tree, options):
enabled_services = options["enabled_services"]
disabled_services = options.get("disabled_services", [])
for service in enabled_services:
subprocess.run([f"systemctl", "--root", tree, "enable", service], check=True)
for service in disabled_services:
subprocess.run([f"systemctl", "--root", tree, "disable", service], check=True)
return 0
if __name__ == '__main__':
args = json.load(sys.stdin)
r = main(args["tree"], args["options"])