Bug 1419182 - Hard code whitelist key; r=mshal
authorGregory Szorc <gps@mozilla.com>
Mon, 20 Nov 2017 14:09:47 -0800
changeset 701834 124bb2bb9b39e124249ea5f609d85b76ddad2969
parent 701833 23c4884d53168a8d6f3a8bec350c5f606f63ac41
child 701835 01ee358a08bfd07d2da22bc877e36d4d519e899a
push id90298
push userbmo:bpostelnicu@mozilla.com
push dateWed, 22 Nov 2017 10:54:01 +0000
reviewersmshal
bugs1419182
milestone59.0a1
Bug 1419182 - Hard code whitelist key; r=mshal We only call this function once. Behavior doesn't need to be parameterized. MozReview-Commit-ID: BR6WU4GSeyO
build/compare-mozconfig/compare-mozconfigs.py
--- a/build/compare-mozconfig/compare-mozconfigs.py
+++ b/build/compare-mozconfig/compare-mozconfigs.py
@@ -31,22 +31,20 @@ def make_hg_url(hgHost, repoPath, protoc
             return repo
         else:
             return '/'.join([p.strip('/') for p in [repo, 'rev', revision]])
     else:
         assert revision
         return '/'.join([p.strip('/') for p in [repo, 'raw-file', revision,
                          filename]])
 
-def readConfig(configfile, keys=[]):
+def readConfig(configfile):
     c = {}
     execfile(configfile, c)
-    for k in keys:
-        c = c[k]
-    return c
+    return c['whitelist']
 
 def verify_mozconfigs(mozconfig_pair, nightly_mozconfig_pair, platform,
                       mozconfigWhitelist={}):
     """Compares mozconfig to nightly_mozconfig and compare to an optional
     whitelist of known differences. mozconfig_pair and nightly_mozconfig_pair
     are pairs containing the mozconfig's identifier and the list of lines in
     the mozconfig."""
 
@@ -132,17 +130,17 @@ if __name__ == '__main__':
 
     logging.basicConfig(level=logging.INFO)
 
     missing_args = options.branch is None or options.revision is None
     if not options.no_download and missing_args:
         logging.error('Not enough arguments to download mozconfigs')
         sys.exit(FAILURE_CODE)
 
-    mozconfig_whitelist = readConfig(options.whitelist, ['whitelist'])
+    mozconfig_whitelist = readConfig(options.whitelist)
 
     for arg in args:
         platform, mozconfig_path, nightly_mozconfig_path = arg.split(',')
 
         mozconfig_lines = get_mozconfig(mozconfig_path, options)
         nightly_mozconfig_lines = get_mozconfig(nightly_mozconfig_path, options)
 
         mozconfig_pair = (mozconfig_path, mozconfig_lines)