mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-11 04:35:57 -06:00
Updated validate.py to optionally accept a specific distro (#9992)
* Updated validate.py to optionally accept a specific distro * Updated to include errors
This commit is contained in:
parent
832904bda5
commit
7f45ed0d0f
@ -61,7 +61,7 @@ def is_unique(collection: list):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print(f'Usage: {sys.argv[0]} /path/to/file', file=sys.stderr)
|
print(f'Usage: {sys.argv[0]} /path/to/file [distroName]', file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
with open(sys.argv[1]) as fd:
|
with open(sys.argv[1]) as fd:
|
||||||
@ -70,8 +70,15 @@ if __name__ == "__main__":
|
|||||||
distros = content['Distributions']
|
distros = content['Distributions']
|
||||||
assert is_unique([e.get('StoreAppId') for e in distros if e])
|
assert is_unique([e.get('StoreAppId') for e in distros if e])
|
||||||
assert is_unique([e.get('Name') for e in distros if e])
|
assert is_unique([e.get('Name') for e in distros if e])
|
||||||
|
|
||||||
|
if len(sys.argv) > 2:
|
||||||
|
# Filter the distros to only the one we want to validate
|
||||||
|
content = { "Distributions": [e for e in content['Distributions'] if e['Name'] == sys.argv[2]] }
|
||||||
|
if not content['Distributions']:
|
||||||
|
raise RuntimeError(f'No distro found for name {sys.argv[2]}')
|
||||||
|
|
||||||
|
|
||||||
for e in content['Distributions']:
|
for e in content['Distributions']:
|
||||||
validate_distro(e)
|
validate_distro(e)
|
||||||
|
|
||||||
print("All checks completed successfully")
|
print("All checks completed successfully")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user