From 5a237b8f8de2c4f2b05f694b10c8b24711e4c17c Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 4 Oct 2024 15:55:45 +0530 Subject: [PATCH] Prefer deployers with names set --- .../deploy/webapp/request_webapp_deployment.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stack_orchestrator/deploy/webapp/request_webapp_deployment.py b/stack_orchestrator/deploy/webapp/request_webapp_deployment.py index 3ea8e776..412f937f 100644 --- a/stack_orchestrator/deploy/webapp/request_webapp_deployment.py +++ b/stack_orchestrator/deploy/webapp/request_webapp_deployment.py @@ -133,11 +133,17 @@ def command( # noqa: C901 # Get deployer record for all the auction winners for auction_winner in auction_winners: # TODO: Match auction winner address with provider address? - deployer_records_by_owner = laconic.webapp_deployers({"--paymentAddress": auction_winner}) + deployer_records_by_owner = laconic.webapp_deployers({"paymentAddress": auction_winner}) if len(deployer_records_by_owner) == 0: print(f"WARNING: Unable to locate deployer for auction winner {auction_winner}") - deployer_records.append(deployer_records_by_owner[0]) + # Take first record with name set + target_deployer_record = deployer_records_by_owner[0] + for r in deployer_records_by_owner: + if len(r.names) > 0: + target_deployer_record = r + break + deployer_records.append(target_deployer_record) else: deployer_record = laconic.get_record(deployer) if not deployer_record: