Bug 1367750 - Allow new keys in Histograms.json if strict_type_checks is False r?Dexter
MozReview-Commit-ID: LyB72VN0tDP
--- a/toolkit/components/telemetry/histogram_tools.py
+++ b/toolkit/components/telemetry/histogram_tools.py
@@ -434,16 +434,18 @@ associated with the histogram. Returns
for key, key_type in type_checked_list_fields.iteritems():
if key not in definition:
continue
if not all(isinstance(x, key_type) for x in definition[key]):
raise ParserError('All values for list "{0}" in histogram "{1}" should be of type'
' {2}.'.format(key, name, nice_type_name(key_type)))
def check_keys(self, name, definition, allowed_keys):
+ if not self._strict_type_checks:
+ return
for key in definition.iterkeys():
if key not in allowed_keys:
raise ParserError('Key "%s" is not allowed for histogram "%s".' % (key, name))
def set_bucket_parameters(self, low, high, n_buckets):
self._low = low
self._high = high
self._n_buckets = n_buckets