diff --git a/mpcdf_common.py b/mpcdf_common.py index 47b23a03c5f03ddac7f8999bda5a8ab635c459b1..76b7d50189e221b162498f7a2a0ff854868acf88 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