diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py index 9a076d11d7f8..4eff89026dd6 100755 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py @@ -457,7 +457,11 @@ def _print_summary_as_json( "user_id": cluster.primary.user_id, "wallet_id": cluster.primary.wallet_id, "disk_space": cluster.primary.disk_space.human_readable(), - "last_heartbeat": cluster.primary.last_heartbeat.isoformat(), + "last_heartbeat": ( + cluster.primary.last_heartbeat.isoformat() + if cluster.primary.last_heartbeat + else "n/a" + ), }, "workers": [ { @@ -806,6 +810,7 @@ async def terminate_dynamic_instances( rich.print("no instances found") raise typer.Exit(1) + assert state.ec2_resource_autoscaling # nosec _print_dynamic_instances( dynamic_autoscaled_instances, state.environment,