runbooks 1.1.2__py3-none-any.whl → 1.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1323,7 +1323,7 @@ class VPCCleanupOptimizer:
1323
1323
  monthly_vpc_endpoint_cost = endpoint_result.monthly_cost
1324
1324
 
1325
1325
  # Data processing costs vary by usage - using conservative estimate per region
1326
- regional_multiplier = pricing_engine.regional_multipliers.get(default_region, 1.0)
1326
+ regional_multiplier = pricing_engine.get_regional_pricing_multiplier('vpc_endpoint', default_region, "us-east-1")
1327
1327
  monthly_data_processing_cost = 50.0 * regional_multiplier # Base estimate adjusted for region
1328
1328
 
1329
1329
  total_annual_savings = 0.0
@@ -75,7 +75,7 @@ class WorkSpacesCostAnalyzer:
75
75
  """
76
76
  WorkSpaces cost optimization analyzer following enterprise patterns.
77
77
 
78
- Implements FinOps-24 requirements with proven profile management and Rich CLI standards.
78
+ Implements WorkSpaces optimization requirements with proven profile management and Rich CLI standards.
79
79
  """
80
80
 
81
81
  def __init__(self, profile: Optional[str] = None):
@@ -84,7 +84,7 @@ class WorkSpacesCostAnalyzer:
84
84
  self.profile = get_profile_for_operation("operational", profile)
85
85
  self.session = boto3.Session(profile_name=self.profile)
86
86
 
87
- # FinOps-24 business targets
87
+ # WorkSpaces optimization business targets
88
88
  self.target_annual_savings = 12518.0
89
89
  self.unused_threshold_days = 90
90
90
  self.analysis_period_days = 30
@@ -286,7 +286,7 @@ class WorkSpacesCostAnalyzer:
286
286
  print_header("WorkSpaces Cost Analysis Summary")
287
287
 
288
288
  summary_table = create_table(
289
- title="FinOps-24: WorkSpaces Optimization Summary",
289
+ title="WorkSpaces Optimization Summary",
290
290
  columns=[
291
291
  {"header": "Metric", "style": "cyan"},
292
292
  {"header": "Count", "style": "green bold"},
@@ -555,6 +555,11 @@ def analyze_workspaces(
555
555
  Analysis results with cost optimization recommendations
556
556
  """
557
557
  try:
558
+ # Initialize variables to prevent scope errors
559
+ results = []
560
+ summary = None
561
+ export_file = None
562
+
558
563
  analyzer = WorkSpacesCostAnalyzer(profile=profile)
559
564
  results, summary = analyzer.analyze_workspaces(
560
565
  unused_days=unused_days,
@@ -573,19 +578,32 @@ def analyze_workspaces(
573
578
  )
574
579
 
575
580
  # Return comprehensive results
576
- return {
577
- "summary": summary.to_dict(),
578
- "workspaces": [result.to_dict() for result in results],
579
- "export_file": export_file,
580
- "achievement_rate": summary.target_achievement_rate,
581
- "status": "success"
582
- }
583
-
581
+ if summary is not None:
582
+ return {
583
+ "summary": summary.to_dict(),
584
+ "workspaces": [result.to_dict() for result in results],
585
+ "export_file": export_file,
586
+ "achievement_rate": summary.target_achievement_rate,
587
+ "status": "success"
588
+ }
589
+ else:
590
+ return {
591
+ "summary": {"error": "Analysis failed before completion"},
592
+ "workspaces": [],
593
+ "export_file": None,
594
+ "achievement_rate": 0,
595
+ "status": "partial_failure"
596
+ }
597
+
584
598
  except Exception as e:
585
599
  print_error(f"WorkSpaces analysis failed: {e}")
586
600
  return {
587
601
  "error": str(e),
588
- "status": "failed"
602
+ "status": "failed",
603
+ "summary": {"error": str(e)},
604
+ "workspaces": [],
605
+ "export_file": None,
606
+ "achievement_rate": 0
589
607
  }
590
608
 
591
609