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
--- 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)