From 04023b63d2f5dcc0440c4d514e8dd7801b8c77f0 Mon Sep 17 00:00:00 2001 From: Difrex Date: Thu, 4 Aug 2016 13:16:06 +0300 Subject: [PATCH] APP_NAME env --- surok.py | 4 +++- surok/templates.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/surok.py b/surok.py index 9d36561..ee60559 100755 --- a/surok.py +++ b/surok.py @@ -52,7 +52,9 @@ while 1: app_hosts = resolve(app_conf, conf) # Populate my dictionary - my = { "services": app_hosts } + my = { "services": app_hosts, + "conf_name": app_conf['conf_name'] + } service_conf = gen(my, app_conf['template']) diff --git a/surok/templates.py b/surok/templates.py index 8056af0..e504898 100644 --- a/surok/templates.py +++ b/surok/templates.py @@ -9,6 +9,7 @@ def gen(my, jj2): f.close() template = Template(temp) + os.environ['APP_NAME'] = my['conf_name'] my['env'] = os.environ return template.render(my=my)