From 105f062f747fcf1ef676980bac716b27ea472616 Mon Sep 17 00:00:00 2001 From: SteBaum Date: Fri, 18 Oct 2024 17:07:46 +0200 Subject: [PATCH] fix: print operations which do not modify in the cluster_status_logs --- tdp/cli/commands/deploy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tdp/cli/commands/deploy.py b/tdp/cli/commands/deploy.py index 2d582023..2dea43e7 100644 --- a/tdp/cli/commands/deploy.py +++ b/tdp/cli/commands/deploy.py @@ -98,11 +98,12 @@ def deploy( dao.session.commit() # Update operation status to RUNNING for operation_rec, process_operation_fn in deployment_iterator: dao.session.commit() # Update deployment and current operation status to RUNNING and next operations to PENDING - if process_operation_fn and (cluster_status_logs := process_operation_fn()): + if process_operation_fn: click.echo( f"Operation {operation_rec.operation} is {operation_rec.state} {'for hosts: ' + operation_rec.host if operation_rec.host is not None else ''}" ) - dao.session.add_all(cluster_status_logs) + if cluster_status_logs := process_operation_fn(): + dao.session.add_all(cluster_status_logs) dao.session.commit() # Update operation status to SUCCESS, FAILURE or HELD if deployment_iterator.deployment.state != DeploymentStateEnum.SUCCESS: