Pythong script for initializing and updating peachcloud debian repo of

microservices.
This commit is contained in:
Max Fowler
2020-11-11 11:21:52 +01:00
parent f69fea4256
commit ce55310c65
7 changed files with 145 additions and 10 deletions

View File

@ -1,5 +1,3 @@
from vars import VARS
import os
import jinja2
import subprocess
@ -20,10 +18,8 @@ def render_template(src, dest, template_vars=None):
:return: None
"""
template = template_env.get_template(src)
if template_vars:
template_vars.update(VARS)
else:
template_vars = VARS
if not template_vars:
template_vars= {}
output_text = template.render(template_vars=template_vars)
if os.path.exists(dest):
os.remove(dest)
@ -31,6 +27,3 @@ def render_template(src, dest, template_vars=None):
f.write(output_text)
def cargo_install(package):
subprocess.call(['/root/.cargo/bin/cargo', 'install', package])