From 549724942d6e85b2aafc32e5062662921ffce1d1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 3 Aug 2022 21:31:17 +0200 Subject: [PATCH] Fix my previous commit /o\ --- packaging_v2/convert_app_to_packaging_v2.py | 9 +++++++-- packaging_v2/convert_v1_manifest_to_v2_for_catalog.py | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packaging_v2/convert_app_to_packaging_v2.py b/packaging_v2/convert_app_to_packaging_v2.py index fd66325..21fe774 100644 --- a/packaging_v2/convert_app_to_packaging_v2.py +++ b/packaging_v2/convert_app_to_packaging_v2.py @@ -37,8 +37,13 @@ def _convert_v1_manifest_to_v2(app_path): "ram.runtime": "50M" } - maintainer = manifest.get("maintainer", {}).get("name") - manifest["maintainers"] = [maintainer] if maintainer else [] + maintainers = manifest.get("maintainer", {}) + if isinstance(maintainers, list): + maintainers = [m['name'] for m in maintainers] + else: + maintainers = [maintainers["name"]] if maintainers.get("name") else [] + + manifest["maintainers"] = maintainers install_questions = manifest["arguments"]["install"] manifest["install"] = {} diff --git a/packaging_v2/convert_v1_manifest_to_v2_for_catalog.py b/packaging_v2/convert_v1_manifest_to_v2_for_catalog.py index 29f24ee..0130c29 100644 --- a/packaging_v2/convert_v1_manifest_to_v2_for_catalog.py +++ b/packaging_v2/convert_v1_manifest_to_v2_for_catalog.py @@ -24,8 +24,13 @@ def convert_v1_manifest_to_v2_for_catalog(manifest): "ram": {"build": "50M", "runtime": "10M"} } - maintainer = manifest.get("maintainer", {}).get("name") - manifest["maintainers"] = [maintainer] if maintainer else [] + maintainers = manifest.get("maintainer", {}) + if isinstance(maintainers, list): + maintainers = [m['name'] for m in maintainers] + else: + maintainers = [maintainers["name"]] if maintainers.get("name") else [] + + manifest["maintainers"] = maintainers install_questions = manifest["arguments"]["install"]