Skip to content
Snippets Groups Projects
Commit c50c9b38 authored by David Schmitz's avatar David Schmitz
Browse files

integrated changes from v1.5

parents 9f57f820 6974248c
No related branches found
No related tags found
No related merge requests found
...@@ -229,11 +229,9 @@ def translate_frag_list(frag_list): ...@@ -229,11 +229,9 @@ def translate_frag_list(frag_list):
def get_frag(rule): def get_frag(rule):
result='' result=''
if rule.fragmenttype: if rule.fragmenttype:
tmp1 = translate_frag_list(rule.fragmenttype.all()) tmp = translate_frag_list(rule.fragmenttype.all())
if tmp1!="": if tmp != "":
result = ',frag'+tmp1 result = ',frag'+tmp
else:
result = ''
return result return result
def create_junos_name(rule): def create_junos_name(rule):
......
...@@ -210,6 +210,16 @@ def helper_rule_ts_parse(ts_string): ...@@ -210,6 +210,16 @@ def helper_rule_ts_parse(ts_string):
except Exception as e: except Exception as e:
logger.info("helper_rule_ts_parse(): ts_string="+str(ts_string)+": got exception "+str(e)) logger.info("helper_rule_ts_parse(): ts_string="+str(ts_string)+": got exception "+str(e))
ts = None ts = None
if ts==None: # other db may hav other time fmt:
logger.info("helper_rule_ts_parse(): trying with milli seconds fmt")
try:
ts = datetime.strptime(ts_string, '%Y-%m-%d %H:%M:%S.%f+00:00') # TODO TZ offset assumed to be 00:00
except Exception as e:
logger.info("helper_rule_ts_parse(): ts_string="+str(ts_string)+": got exception "+str(e))
ts = None
logger.info("helper_rule_ts_parse(): => ts="+str(ts))
return ts return ts
def process_new_snmp_measurements__low_level(nowstr, samplecount, newdata, history): def process_new_snmp_measurements__low_level(nowstr, samplecount, newdata, history):
......
...@@ -58,7 +58,8 @@ LOG_FILENAME = os.path.join(settings.LOG_FILE_LOCATION, 'gunicorn_views.log') ...@@ -58,7 +58,8 @@ LOG_FILENAME = os.path.join(settings.LOG_FILE_LOCATION, 'gunicorn_views.log')
# FORMAT = '%(asctime)s %(levelname)s: %(message)s' # FORMAT = '%(asctime)s %(levelname)s: %(message)s'
# logging.basicConfig(format=FORMAT) # logging.basicConfig(format=FORMAT)
#formatter = logging.Formatter('%(asctime)s %(levelname)s %(clientip)s %(user)s: %(message)s') # leads to strange errors on test-lab #formatter = logging.Formatter('%(asctime)s %(levelname)s %(clientip)s %(user)s: %(message)s') # leads to strange errors on test-lab
formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s') #formatter = logging.Formatter('%(asctime)s %(levelname)s %(user)s: %(message)s')
formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment