This commit is contained in:
Denis Zheleztsov 2017-01-11 00:24:14 +03:00
parent d63f2a5f3a
commit 95abf430c8

View File

@ -5,11 +5,11 @@ 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
import argparse
from surok.templates import gen from surok.templates import gen
from surok.discovery import resolve from surok.discovery import resolve
from surok.system import reload_conf from surok.system import reload_conf
import argparse
# Load base configurations # Load base configurations
surok_conf = '/etc/surok/conf/surok.json' surok_conf = '/etc/surok/conf/surok.json'
@ -19,7 +19,7 @@ parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', help='surok.json path') parser.add_argument('-c', '--config', help='surok.json path')
args = parser.parse_args() args = parser.parse_args()
if args.config: if args.config:
surok_conf = args.config surok_conf = args.config
# Read config file # Read config file
f = open(surok_conf, 'r') f = open(surok_conf, 'r')
@ -58,10 +58,9 @@ while 1:
# Will be removed later # Will be removed later
# For old configs # For old configs
try: loglevel = 'info'
if 'loglevel' in conf:
loglevel = conf['loglevel'] loglevel = conf['loglevel']
except:
conf['loglevel'] = 'info'
# Resolve services # Resolve services
app_hosts = resolve(app_conf, conf) app_hosts = resolve(app_conf, conf)