From b8a0fb5a4f18696aece15d7c11ca9984f1327e6c Mon Sep 17 00:00:00 2001 From: jungle Date: Wed, 10 Apr 2024 18:08:45 +0100 Subject: [PATCH] fix no project in config context error --- helpers/cudo_api.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/helpers/cudo_api.py b/helpers/cudo_api.py index 7b105f1..8eca7f5 100644 --- a/helpers/cudo_api.py +++ b/helpers/cudo_api.py @@ -34,7 +34,7 @@ def get_project_id(): if 'project' in context_config: return context_config['project'], None else: - return None, Exception("No project set in configuration") + return None, Exception('No project set in configuration (cudo.yml)') else: return None, error @@ -46,6 +46,14 @@ def project_id(): return '' +def project_id_throwable(): + p, e = get_project_id() + if e is None: + return p + else: + raise e + + # APIs def api_keys(): c, err = client()