From: Moritz Warning Date: Sun, 24 May 2020 21:45:34 +0000 (+0200) Subject: fix for different profiles.json format X-Git-Tag: v2.2.1~20 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=50da32c5f711c45a31f3113f1706e51ae9ea2a15;p=web%2Ffirmware-selector-openwrt-org.git fix for different profiles.json format --- diff --git a/misc/collect.py b/misc/collect.py index 8ac6e76..e9b91d2 100755 --- a/misc/collect.py +++ b/misc/collect.py @@ -52,6 +52,9 @@ def add_profile(id, target, profile): for image in profile['images']: images.append({'name': image['name'], 'type': image['type']}) + if target is None: + target = profile['target'] + if args.change_prefix: change_prefix(images, 'openwrt-', args.change_prefix) @@ -89,7 +92,7 @@ for path in paths: try: if 'profiles' in obj: for id in obj['profiles']: - add_profile(id, obj['target'], obj['profiles'][id]) + add_profile(id, obj.get('target'), obj['profiles'][id]) else: add_profile(obj['id'], obj['target'], obj) except json.decoder.JSONDecodeError as e: