Fix target deployer resolution

This commit is contained in:
Prathamesh Musale 2024-10-03 17:50:18 +05:30
parent 37a436b44c
commit 04989eb29a

View File

@ -183,7 +183,9 @@ def command( # noqa: C901
if not response.ok: if not response.ok:
response.raise_for_status() 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 = { deployment_request = {
"record": { "record": {
@ -191,7 +193,7 @@ def command( # noqa: C901
"application": app, "application": app,
"version": "1.0.0", "version": "1.0.0",
"name": f"{app_record.attributes.name}@{app_record.attributes.version}", "name": f"{app_record.attributes.name}@{app_record.attributes.version}",
"deployer": deployer, "deployer": target_deployer,
"meta": {"when": str(datetime.utcnow())}, "meta": {"when": str(datetime.utcnow())},
} }
} }