Don't use tee to write service unit files

We are running as root now directly, no need to tee
This commit is contained in:
yuvipanda
2018-06-27 02:10:26 -07:00
parent e957fc3bf0
commit aa522faf7f

View File

@@ -23,10 +23,8 @@ def install_unit(name, unit, path='/etc/systemd/system'):
"""
Install unit wih given name
"""
subprocess.run([
'tee',
os.path.join(path, name)
], input=unit.encode('utf-8'), check=True)
with open(os.path.join(path, name), 'w') as f:
f.write(unit)
def uninstall_unit(name, path='/etc/systemd/system'):