Backed out changeset 66138e53fec2 (bug 1365577) for flake8 failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 25 May 2017 15:49:31 -0400
changeset 360677 f1342f98acb1
parent 360676 8db29d17d984
child 360678 297b1dcda856
push id43435
push userryanvm@gmail.com
push dateThu, 25 May 2017 19:49:38 +0000
treeherderautoland@f1342f98acb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1365577
milestone55.0a1
backs out66138e53fec2
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 66138e53fec2 (bug 1365577) for flake8 failures.
toolkit/components/telemetry/histogram_tools.py
--- a/toolkit/components/telemetry/histogram_tools.py
+++ b/toolkit/components/telemetry/histogram_tools.py
@@ -69,31 +69,30 @@ def exponential_buckets(dmin, dmax, n_bu
         ret_array[bucket_index] = current
     return ret_array
 
 always_allowed_keys = ['kind', 'description', 'cpp_guard', 'expires_in_version',
                        'alert_emails', 'keyed', 'releaseChannelCollection',
                        'bug_numbers', 'record_in_processes']
 
 whitelists = None
-
-def load_whitelist():
-    try:
-        whitelist_path = os.path.join(os.path.abspath(os.path.realpath(os.path.dirname(__file__))),
-                                      'histogram-whitelists.json')
-        with open(whitelist_path, 'r') as f:
-            try:
-                whitelists = json.load(f)
-                for name, whitelist in whitelists.iteritems():
-                    whitelists[name] = set(whitelist)
-            except ValueError, e:
-                raise ParserError('Error parsing whitelist: %s' % whitelist_path)
-    except IOError:
-        whitelists = None
-        raise ParserError('Unable to parse whitelist: %s.' % whitelist_path)
+try:
+    whitelist_path = os.path.join(os.path.abspath(os.path.realpath(os.path.dirname(__file__))),
+                                  'histogram-whitelists.json')
+    with open(whitelist_path, 'r') as f:
+        try:
+            whitelists = json.load(f)
+            for name, whitelist in whitelists.iteritems():
+                whitelists[name] = set(whitelist)
+        except ValueError, e:
+            raise ParserError('Error parsing whitelist: %s' % whitelist_path)
+except IOError:
+    whitelists = None
+    print('Unable to parse whitelist: %s.\nAssuming all histograms are acceptable.' %
+          whitelist_path)
 
 
 class Histogram:
     """A class for representing a histogram definition."""
 
     def __init__(self, name, definition, strict_type_checks=False):
         """Initialize a histogram named name with the given definition.
 definition is a dict-like object that must contain at least the keys:
@@ -590,19 +589,16 @@ try:
 except ImportError:
     pass
 
 
 def from_files(filenames, strict_type_checks=True):
     """Return an iterator that provides a sequence of Histograms for
 the histograms defined in filenames.
     """
-    if strict_type_checks:
-        load_whitelist()
-
     all_histograms = OrderedDict()
     for filename in filenames:
         parser = FILENAME_PARSERS[os.path.basename(filename)]
         histograms = parser(filename, strict_type_checks)
 
         # OrderedDicts are important, because then the iteration order over
         # the parsed histograms is stable, which makes the insertion into
         # all_histograms stable, which makes ordering in generated files