From d2a9606ddc03891ddc46af3f03229e79195c787b Mon Sep 17 00:00:00 2001 From: Petr Balogh Date: Tue, 2 Jan 2024 17:24:17 +0100 Subject: [PATCH] Append custom prefixes at start of dictionary for AWS cleanup script Signed-off-by: Petr Balogh --- ocs_ci/cleanup/aws/cleanup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocs_ci/cleanup/aws/cleanup.py b/ocs_ci/cleanup/aws/cleanup.py index 655a59b8e3f..84178d2f299 100644 --- a/ocs_ci/cleanup/aws/cleanup.py +++ b/ocs_ci/cleanup/aws/cleanup.py @@ -178,7 +178,7 @@ def determine_cluster_deletion(ec2_instances, cluster_name): logger.info( f"Instance {[tag['Value'] for tag in instance.tags if tag['Key'] == 'Name'][0]} " f"(id: {instance.id}) running time is {running_time} hours while the allowed" - f" running time for it is {allowed_running_time/3600} hours" + f" running time for it is {allowed_running_time / 3600} hours" ) if running_time.total_seconds() > allowed_running_time: return True @@ -383,7 +383,7 @@ def aws_cleanup(): logger.info( "Adding special rule for prefix '%s' with hours %s", prefix, hours ) - prefixes_hours_to_spare.update({prefix: hours}) + prefixes_hours_to_spare = {**{prefix: hours}, **prefixes_hours_to_spare} time_to_delete = args.hours * 60 * 60 if args.hours else None region = defaults.AWS_REGION if not args.region else args.region