utils_devops 0.1.138__tar.gz → 0.1.139__tar.gz

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.
Files changed (24) hide show
  1. {utils_devops-0.1.138 → utils_devops-0.1.139}/PKG-INFO +1 -1
  2. {utils_devops-0.1.138 → utils_devops-0.1.139}/pyproject.toml +1 -1
  3. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/docker_ops.py +29 -2
  4. {utils_devops-0.1.138 → utils_devops-0.1.139}/README.md +0 -0
  5. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/__init__.py +0 -0
  6. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/__init__.py +0 -0
  7. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/datetimes.py +0 -0
  8. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/envs.py +0 -0
  9. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/files.py +0 -0
  10. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/logs.py +0 -0
  11. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/script_helpers.py +0 -0
  12. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/strings.py +0 -0
  13. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/core/systems.py +0 -0
  14. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/__init__.py +0 -0
  15. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/aws_ops.py +0 -0
  16. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/git_ops.py +0 -0
  17. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/interaction_ops.py +0 -0
  18. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/metrics_ops.py +0 -0
  19. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/network_ops.py +0 -0
  20. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/nginx_ops.py +0 -0
  21. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/notification_ops.py +0 -0
  22. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/performance_ops.py +0 -0
  23. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/ssh_ops.py +0 -0
  24. {utils_devops-0.1.138 → utils_devops-0.1.139}/src/utils_devops/extras/vault_ops.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: utils_devops
3
- Version: 0.1.138
3
+ Version: 0.1.139
4
4
  Summary: Lightweight DevOps utilities for automation scripts: config editing (YAML/JSON/INI/.env), templating, diffing, and CLI tools
5
5
  License: MIT
6
6
  Keywords: devops,automation,nginx,cli,jinja2,yaml,config,diff,templating,logging,docker,compose,file-ops
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "utils_devops"
3
- version = "0.1.138" # Bumped for new string features + diffing
3
+ version = "0.1.139" # Bumped for new string features + diffing
4
4
  description = "Lightweight DevOps utilities for automation scripts: config editing (YAML/JSON/INI/.env), templating, diffing, and CLI tools"
5
5
  authors = ["Hamed Sheikhan <sh.sheikhan.m@gmail.com>"]
6
6
  license = "MIT"
@@ -1281,6 +1281,8 @@ def _check_missing_images(
1281
1281
 
1282
1282
  return missing_services
1283
1283
 
1284
+ from collections import defaultdict # Add this import at the top of your file
1285
+
1284
1286
  def _perform_health_checks(
1285
1287
  compose_file: str,
1286
1288
  services: List[str],
@@ -1312,7 +1314,32 @@ def _perform_health_checks(
1312
1314
  # Get detailed health status for all services
1313
1315
  detailed_health = _get_detailed_health_status(compose_file, services, logger)
1314
1316
 
1315
- healthy_count = sum(1 for status in detailed_health.values() if status.get('overall_status') == 'healthy')
1317
+ # Group services by overall_status for detailed logging
1318
+ status_groups = defaultdict(list)
1319
+ for service, status in detailed_health.items():
1320
+ overall = status['overall_status']
1321
+ if overall == 'healthy':
1322
+ status_groups[overall].append(service)
1323
+ else:
1324
+ detail = f"{service}: {status['status']} (health: {status['health']}) | Error: {status['error']}"
1325
+ status_groups[overall].append(detail)
1326
+
1327
+ # Log grouped statuses
1328
+ statuses = ['healthy', 'starting', 'restarting', 'unhealthy', 'not found']
1329
+ emojis = {'healthy': '✅', 'starting': '🚀', 'restarting': '🔄', 'unhealthy': '❌', 'not found': '❓'}
1330
+
1331
+ for status in statuses:
1332
+ group = status_groups[status]
1333
+ if group:
1334
+ emoji = emojis[status]
1335
+ logger.info(f"{emoji} {status.capitalize()} ({len(group)}):")
1336
+ if status == 'healthy':
1337
+ logger.info(f" {sorted(group)}")
1338
+ else:
1339
+ for detail in sorted(group):
1340
+ logger.info(f" - {detail}")
1341
+
1342
+ healthy_count = len(status_groups['healthy'])
1316
1343
  unhealthy_count = len(services) - healthy_count
1317
1344
 
1318
1345
  logger.info(f" Healthy: {healthy_count}/{len(services)}, Unhealthy: {unhealthy_count}")
@@ -1347,7 +1374,7 @@ def _get_detailed_health_status(
1347
1374
  'error': service_status.get('error', 'No error details'),
1348
1375
  'overall_status': overall_status
1349
1376
  }
1350
- logger.info(f" {service}: {overall_status}")
1377
+ # Removed: logger.info(f" {service}: {overall_status}") # Now handled grouped in _perform_health_checks
1351
1378
 
1352
1379
  except Exception as e:
1353
1380
  logger.error(f"Failed to get detailed health status: {e}")
File without changes