Bug 1419128 - Hard code whitelist key; r?build draft
authorGregory Szorc <gps@mozilla.com>
Mon, 20 Nov 2017 14:09:47 -0800
changeset 700806 c241240e313b6c128b95522afae64251e6a23144
parent 700805 bf2fb09981b6eebb3ee3a24c8fcefcc60e33dbf3
child 700807 6b6fb08db8c46a4fd75822326543fb63a903daea
push id89984
push userbmo:gps@mozilla.com
push dateMon, 20 Nov 2017 23:14:50 +0000
reviewersbuild
bugs1419128
milestone59.0a1
Bug 1419128 - Hard code whitelist key; r?build We only call this function once. Behavior doesn't need to be parameterized.
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)