From 02c2045df2f94e747debf51273706334ea4e31c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lorenz=20H=C3=BCdepohl?= <dev@stellardeath.org>
Date: Fri, 24 May 2024 10:43:04 +0200
Subject: [PATCH] Fix 'Internal Server Error' on mpcdf_setup_subproject

Was caused by passing the parameter 'with_project=0' due to it being
'False' in python, instead of not passing it at all by setting it to
'None'.
---
 mpcdf_common.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mpcdf_common.py b/mpcdf_common.py
index 47b23a0..76b7d50 100644
--- a/mpcdf_common.py
+++ b/mpcdf_common.py
@@ -350,7 +350,7 @@ def chunked(items, chunksize):
         i += 1
 
 
-def get_attribute(api_url, project, package, attribute, with_project=False):
+def get_attribute(api_url, project, package, attribute, with_project=None):
     attribute_meta = osc.core.show_attribute_meta(api_url, project, package, None, attribute, False, with_project)
     if attribute_meta is None:
         raise osc.oscerr.APIError("Cannot fetch value for attribute '{0}' from {1}".format(attribute, (project, package)))
@@ -397,14 +397,14 @@ def get_allowed_attribute_values(api_url, attribute):
     return list(value.text for value in root.findall("./allowed/value"))
 
 
-def get_attribute_values(api_url, project, package, attribute, with_project=False):
+def get_attribute_values(api_url, project, package, attribute, with_project=None):
     root = get_attribute(api_url, project, package, attribute, with_project)
     attribute = root.find("./attribute")
     return list(value.text for value in attribute.findall("./value"))
 
 
-def get_attribute_value(api_url, project, package, attribute, with_project=False):
-    value, = get_attribute_values(api_url, project, package, attribute, with_project=False)
+def get_attribute_value(api_url, project, package, attribute, with_project=None):
+    value, = get_attribute_values(api_url, project, package, attribute, with_project=with_project)
     return value
 
 
-- 
GitLab