Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/notifications/parser.py

Issue 29372800: [sitescripts] Issue 4827 - Added support for "relentless" notifications (Closed)
Patch Set: Fixed indentation Created Jan. 25, 2017, 11:48 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sitescripts/notifications/test/parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/notifications/parser.py
diff --git a/sitescripts/notifications/parser.py b/sitescripts/notifications/parser.py
index ba637e372070b8372e295ac82460ffd24a51657a..4fdf6429b317fae68d5872f705908e1665d96d99 100644
--- a/sitescripts/notifications/parser.py
+++ b/sitescripts/notifications/parser.py
@@ -69,7 +69,7 @@ def _parse_notification(data, name):
if key == 'inactive' and not is_variant:
current['inactive'] = value.lower() not in ('', '0', 'no', 'false', 'off')
elif key == 'severity':
- if value not in ('information', 'critical', 'normal'):
+ if value not in ('information', 'critical', 'normal', 'relentless'):
raise Exception("Unknown severity value '%s' in file '%s'" % (value, name))
current['severity'] = value
elif key == 'links':
@@ -90,6 +90,8 @@ def _parse_notification(data, name):
current['sample'] = float(value)
elif key in ['start', 'end']:
current[key] = datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M')
+ elif key == 'interval':
+ current[key] = int(value)
else:
raise Exception("Unknown parameter '%s' in file '%s'" % (key, name))
« no previous file with comments | « no previous file | sitescripts/notifications/test/parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld