Validate options in gerrit/projects
Check that only known options are used in gerrit/projects.yaml. Change-Id: I4ba62547e71b21d8c32297ba06b4aa937f9b637e
This commit is contained in:
parent
0ed1587691
commit
2304cb56b3
@ -82,6 +82,7 @@ def main():
|
||||
VALID_SCHEMES = ['https://', 'http://', 'git://']
|
||||
DESCRIPTION_REQUIRED = ['openstack', 'openstack-infra', 'openstack-dev',
|
||||
'stackforge']
|
||||
VALID_OPTIONS = ['delay-release', 'track-upstream', 'translate']
|
||||
|
||||
for p in projects:
|
||||
name = p.get('project')
|
||||
@ -142,6 +143,12 @@ def main():
|
||||
found_errors += 1
|
||||
print("Error: Unknown keyword '%s' in project %s" %
|
||||
(entry, name))
|
||||
# Check for valid options
|
||||
for option in p.get('options', []):
|
||||
if not option in VALID_OPTIONS:
|
||||
found_errors += 1
|
||||
print("Error: Unknown option '%s' in project %s" %
|
||||
(option, name))
|
||||
|
||||
if found_errors:
|
||||
print("Found %d error(s) in %s" % (found_errors, args.infile))
|
||||
|
Loading…
Reference in New Issue
Block a user