Skip to content

Commit

Permalink
remove list of non-central buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 2, 2026
1 parent b092738 commit 16d875b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions local-app/python-tools/cross-organization/assess_check_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import glob

# --- VERSIONING ---
__version__ = "1.0.6"
__version__ = "1.0.7"

def find_latest_file(pattern):
"""Searches for the most recent file matching the pattern."""
Expand Down Expand Up @@ -40,7 +40,8 @@ def main():
print("-" * 140)

stats = {
"objects": 0, "size_bytes": 0, "non_central_buckets": set(),
"objects": 0, "size_bytes": 0,
"central_buckets": set(), "non_central_buckets": set(),
"total_recorders": 0, "accounts": len(data)
}

Expand All @@ -61,23 +62,25 @@ def main():
stats["objects"] += reg_data.get("object_count", 0)
stats["size_bytes"] += reg_data.get("bucket_size_bytes", 0)

if bucket != "N/A" and not re.match(args.central_bucket_regex, bucket):
s3_issues.append(bucket)
stats["non_central_buckets"].add(bucket)
if bucket != "N/A":
if re.match(args.central_bucket_regex, bucket):
stats["central_buckets"].add(bucket)
else:
s3_issues.append(bucket)
stats["non_central_buckets"].add(bucket)

s3_status = "NON_COMPLIANT" if s3_issues else "COMPLIANT"
print(f"{acc_id:<15} | {ou_path[:30]:<30} | {summary:<12} | {s3_status}")

# RESTORED SUMMARY SECTION
# SUMMARY SECTION
size_gb = stats["size_bytes"] / (1024**3)
print("-" * 140)
print(f"ORGANIZATION FOOTPRINT SUMMARY (CONFIG) | Org ID: {org_id}")
print(f" Active Recorders: {stats['total_recorders']}")
print(f" Total S3 Objects: {stats['objects']:,}")
print(f" Total S3 Storage: {size_gb:.2f} GB")
print(f" Central Buckets: {len(stats['central_buckets'])}")
print(f" Non-Central Buckets: {len(stats['non_central_buckets'])}")
for b in sorted(stats["non_central_buckets"]):
print(f" - {b}")
print("-" * 140)

if __name__ == "__main__":
Expand Down

0 comments on commit 16d875b

Please sign in to comment.