1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-15 08:36:13 +01:00
github.com_openSUSE_osc/osc/_private/api_configuration.py

13 lines
381 B
Python
Raw Normal View History

from . import api
from .. import oscerr
def get_configuration_value(apiurl, option):
url_path = ["configuration"]
url_query = {}
root = api.get(apiurl, url_path, url_query)
node = api.find_node(root, "configuration", option)
if node is None or not node.text:
raise oscerr.APIError(f"Couldn't get configuration option '{option}'")
return node.text