Skip to content

Commit

Permalink
Append custom prefixes at start of dictionary for AWS cleanup script
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Balogh <[email protected]>
  • Loading branch information
petr-balogh committed Jan 2, 2024
1 parent cc1f7b0 commit d2a9606
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocs_ci/cleanup/aws/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d2a9606

Please sign in to comment.