From f7aeab90e35c6f3ebefcad3310f4196b0628af6f Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Fri, 22 Aug 2025 19:30:22 -0700 Subject: [PATCH] fix script --- backend/utils/scripts/stop_started_sandboxes.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/utils/scripts/stop_started_sandboxes.py b/backend/utils/scripts/stop_started_sandboxes.py index 5911516d..7587bdfb 100644 --- a/backend/utils/scripts/stop_started_sandboxes.py +++ b/backend/utils/scripts/stop_started_sandboxes.py @@ -101,18 +101,23 @@ def stop_started_sandboxes(dry_run: bool = False, save_json: bool = False, json_ # Print sample sandbox data for debugging if all_sandboxes: - logger.debug("Sample sandbox data structure:") + logger.info("Sample sandbox data structure:") sample_sandbox = all_sandboxes[0] - logger.debug(f" - ID: {getattr(sample_sandbox, 'id', 'N/A')}") - logger.debug(f" - State: {getattr(sample_sandbox, 'state', 'N/A')}") - logger.debug(f" - Name: {getattr(sample_sandbox, 'name', 'N/A')}") + logger.info(f" - ID: {getattr(sample_sandbox, 'id', 'N/A')}") + logger.info(f" - State: {getattr(sample_sandbox, 'state', 'N/A')}") + logger.info(f" - Name: {getattr(sample_sandbox, 'name', 'N/A')}") + + # Show a few more samples to see different states + logger.info("Additional samples:") + for i, sb in enumerate(all_sandboxes[1:6]): # Show next 5 samples + logger.info(f" Sample {i+2}: State='{getattr(sb, 'state', 'N/A')}', ID={getattr(sb, 'id', 'N/A')[:20]}...") except Exception as e: logger.error(f"✗ Failed to list sandboxes: {e}") return {"error": 1} # Filter for STARTED sandboxes - started_sandboxes = [sb for sb in all_sandboxes if getattr(sb, 'state', None) == 'STARTED'] + started_sandboxes = [sb for sb in all_sandboxes if getattr(sb, 'state', None) == 'started'] logger.info(f"✓ Found {len(started_sandboxes)} sandboxes in STARTED state") # Save to JSON if requested