From d76476e05859015bf06cd5cf8b84ff6c04dd3877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Sat, 25 Feb 2023 22:25:59 +0100 Subject: [PATCH] Fix secret parsing Currently builds which use secrets will fail [1] with: Error: GetSecret: pq: invalid input syntax for type uuid: "None" That is caused by the uuid_or_string function never returning anything, so the secrets array will simply consist of "None". [1]: https://builds.sr.ht/~sircmpwn/job/947773 --- buildsrht/manifest.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/buildsrht/manifest.py b/buildsrht/manifest.py index 4cd29c3..e1d66d4 100644 --- a/buildsrht/manifest.py +++ b/buildsrht/manifest.py @@ -89,12 +89,11 @@ class Manifest: def uuid_or_string(s): try: - uuid.UUID(s) + return uuid.UUID(s) except ValueError: if len(s) >= 3 and len(s) <= 512: - s - else: - raise Exception("Secret names must be between 3 and 512 chars") + return s + raise Exception("Secret names must be between 3 and 512 chars") secrets = list(map(uuid_or_string, secrets)) if shell is not None and not isinstance(shell, bool): -- 2.38.5