OS environment for app conf

This commit is contained in:
Difrex 2016-08-09 15:40:07 +03:00
parent 20155298ed
commit c173a68f5e

View File

@ -1,6 +1,7 @@
#!/usr/bin/python3 #!/usr/bin/python3
from time import sleep from time import sleep
import os
from os import listdir from os import listdir
from os.path import isfile, join from os.path import isfile, join
import json import json
@ -38,10 +39,13 @@ def get_configs():
# Get Surok App configuration # Get Surok App configuration
# Read app conf from file and return dict # Read app conf from file and return dict
def load_app_conf(app): def load_app_conf(app):
# Load OS environment to app_conf
f = open(conf['confd'] + '/' + app) f = open(conf['confd'] + '/' + app)
c = json.loads(f.read()) c = json.loads(f.read())
f.close() f.close()
c['env'] = os.environ
return c return c