Bug 1419182 - Hard code whitelist key; r?build draft
authorGregory Szorc <gps@mozilla.com>
Mon, 20 Nov 2017 14:09:47 -0800
changeset 700831 88667475c01c4a458c42b3f93e592c2c24b4f2eb
parent 700830 847e262f6af3b9fe2f1e4880ac5206790e25dbd6
child 700832 a1794eb7a5e9ee38b1e8d4ce09251bfd12699f2b
push id89987
push userbmo:gps@mozilla.com
push dateMon, 20 Nov 2017 23:19:57 +0000
reviewersbuild
bugs1419182
milestone59.0a1
Bug 1419182 - Hard code whitelist key; r?build 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)