From 385d669e3cba7bab3e80400432a452f58c24c965 Mon Sep 17 00:00:00 2001 From: badra001 Date: Tue, 10 Mar 2026 15:30:24 -0400 Subject: [PATCH] add file list --- .../assess_check_scheduling.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/local-app/python-tools/cross-organization/assess_check_scheduling.py b/local-app/python-tools/cross-organization/assess_check_scheduling.py index 7186a58b..382d6782 100755 --- a/local-app/python-tools/cross-organization/assess_check_scheduling.py +++ b/local-app/python-tools/cross-organization/assess_check_scheduling.py @@ -4,7 +4,7 @@ from datetime import datetime # --- VERSIONING --- -__version__ = "1.6.0" +__version__ = "1.6.1" def find_latest_file(pattern): """Locates the most recent check_scheduling JSON file.""" @@ -12,7 +12,7 @@ def find_latest_file(pattern): return max(files, key=os.path.getctime) if files else None def main(): - parser = argparse.ArgumentParser(description="PowerSchedule Assessor - v1.6.0") + parser = argparse.ArgumentParser(description="PowerSchedule Assessor - v1.6.1") parser.add_argument("--input", help="JSON audit file") parser.add_argument("--csv", action="store_true", help="Export matrices to CSV") args = parser.parse_args() @@ -36,6 +36,7 @@ def main(): ec2_groups = Counter({"plain": 0, "asg": 0, "eks": 0}) total_resources = 0 all_envs = set() + created_files = [] # Track created files for summary for account in data: acc_id = account.get('account_id') @@ -47,13 +48,16 @@ def main(): res_type = val.get("type", "unknown") if res_type == "eks_node": - cat, ec2_groups["eks"] = "eks_ec2", ec2_groups["eks"] + 1 + cat = "eks_ec2" + ec2_groups["eks"] += 1 elif res_type == "asg_member": - cat, ec2_groups["asg"] = "asg_ec2", ec2_groups["asg"] + 1 + cat = "asg_ec2" + ec2_groups["asg"] += 1 elif res_type == "rds": cat = "rds" else: - cat, ec2_groups["plain"] = "plain_ec2", ec2_groups["plain"] + 1 + cat = "plain_ec2" + ec2_groups["plain"] += 1 if val.get("eks_cluster") and val.get("eks_cluster") != "N/A": eks_clusters.add(f"{acc_id}:{val.get('eks_cluster')}") @@ -104,7 +108,7 @@ def main(): row_pct = (row_total / type_totals[cat]) * 100 env_counts = [r3_data[cat][tag][env] for env in sorted_envs] writer.writerow([tag, row_total, f"{row_pct:.1f}%"] + env_counts) - print(f"Exported: {fname}") + created_files.append(fname) # --- ORG SUMMARY --- print("\n" + "=" * report_width) @@ -114,6 +118,11 @@ def main(): print(f" Total ASGs Identified: {len(asg_names)}") print(f" Total EKS Clusters: {eks_cluster_count}") print(f" Average Nodes/Cluster: {eks_avg:.1f}") + + if created_files: + print(f"\n FILES CREATED:") + for f in created_files: + print(f" - {f}") print("=" * report_width) if __name__ == "__main__": main()