From 48de1b05397dfad601712e22a91ab2fc13fb2ba8 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 3 Oct 2024 17:50:18 +0530 Subject: [PATCH] Fix target deployer resolution --- .../deploy/webapp/request_webapp_deployment.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stack_orchestrator/deploy/webapp/request_webapp_deployment.py b/stack_orchestrator/deploy/webapp/request_webapp_deployment.py index 4cd6e046..2da2bbaf 100644 --- a/stack_orchestrator/deploy/webapp/request_webapp_deployment.py +++ b/stack_orchestrator/deploy/webapp/request_webapp_deployment.py @@ -183,7 +183,9 @@ def command( # noqa: C901 if not response.ok: response.raise_for_status() - config_ref = response.json()["id"] + target_deployer = deployer + if (not deployer) and len(deployer_record.names): + target_deployer = deployer_record.names[0] deployment_request = { "record": { @@ -191,7 +193,7 @@ def command( # noqa: C901 "application": app, "version": "1.0.0", "name": f"{app_record.attributes.name}@{app_record.attributes.version}", - "deployer": deployer, + "deployer": target_deployer, "meta": {"when": str(datetime.utcnow())}, } }