katalon-cli 0.5.0__tar.gz → 0.5.1__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 (22) hide show
  1. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/PKG-INFO +1 -1
  2. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/pyproject.toml +1 -1
  3. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/pyproject.toml.orig +1 -1
  4. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/checks.py +16 -20
  5. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/README.md +0 -0
  6. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/__init__.py +0 -0
  7. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/__init__.py +0 -0
  8. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/backup.py +0 -0
  9. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/compose_gen.py +0 -0
  10. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/docker.py +0 -0
  11. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/images.py +0 -0
  12. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/paths.py +0 -0
  13. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/permissions.py +0 -0
  14. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/reindex.py +0 -0
  15. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/release.py +0 -0
  16. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/selfupdate.py +0 -0
  17. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/core/state.py +0 -0
  18. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/main.py +0 -0
  19. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/py.typed +0 -0
  20. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/templates/Caddyfile.j2 +0 -0
  21. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/templates/compose.yaml.j2 +0 -0
  22. {katalon_cli-0.5.0 → katalon_cli-0.5.1}/src/katalon_cli/templates/nginx.conf.j2 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: katalon-cli
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: Installer & Updater CLI für Katalon Production-Instanzen
5
5
  Author: Karl Krägelin
6
6
  Author-email: Karl Krägelin <karlkraegelin@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "katalon-cli"
3
- version = "0.5.0"
3
+ version = "0.5.1"
4
4
  description = "Installer & Updater CLI für Katalon Production-Instanzen"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "katalon-cli"
3
- version = "0.5.0"
3
+ version = "0.5.1"
4
4
  description = "Installer & Updater CLI für Katalon Production-Instanzen"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -8,10 +8,11 @@ import subprocess
8
8
  from dataclasses import dataclass
9
9
  from pathlib import Path
10
10
 
11
+ from . import docker
12
+
11
13
  MIN_FREE_DISK_GB = 5
12
14
  # Elasticsearch verweigert Shard-Allokation ab 90 % (high watermark).
13
15
  MAX_USED_PERCENT = 90
14
- REAL_FS = {"ext2", "ext3", "ext4", "xfs", "btrfs", "zfs", "f2fs"}
15
16
 
16
17
 
17
18
  @dataclass
@@ -52,30 +53,25 @@ def check_disk_space(path: Path, min_gb: int = MIN_FREE_DISK_GB) -> CheckResult:
52
53
  "Diskspace", ok, f"{free_gb:.1f} GB frei (min. {min_gb} GB) in {path}"
53
54
  )
54
55
 
55
- def _mount_points(instance_dir: Path) -> list[Path]:
56
- """Alle echten Dateisysteme des Hosts; ohne /proc/mounts Instanzverzeichnis und `/`."""
57
- try:
58
- lines = Path("/proc/mounts").read_text().splitlines()
59
- except OSError:
60
- return [instance_dir, Path("/")]
61
- return [Path(f[1].replace("\\040", " ")) for f in map(str.split, lines) if f[2] in REAL_FS]
56
+ ES_DATA_PATH = "/usr/share/elasticsearch/data"
62
57
 
63
58
 
64
59
  def check_server_disk(instance_dir: Path, max_used: int = MAX_USED_PERCENT) -> CheckResult:
65
- full = []
66
- for mount in _mount_points(instance_dir):
67
- try:
68
- usage = shutil.disk_usage(mount)
69
- except OSError:
70
- continue
71
- used = usage.used * 100 / (usage.used + usage.free)
72
- if used >= max_used:
73
- full.append(f"{mount} {used:.0f} %")
74
- if full:
60
+ """Belegung des Dateisystems mit dem Elasticsearch-Datenpfad, gemessen im Container (auch Docker Desktop)."""
61
+ if not docker.is_running(instance_dir, "elasticsearch"):
62
+ return CheckResult("Server-Disk", True, "Elasticsearch läuft nicht — Prüfung übersprungen")
63
+ result = docker.compose(
64
+ instance_dir, "exec", "-T", "elasticsearch", "df", "-Pk", ES_DATA_PATH, check=False, capture=True
65
+ )
66
+ try:
67
+ used = int(result.stdout.splitlines()[-1].split()[4].rstrip("%"))
68
+ except (IndexError, ValueError):
69
+ return CheckResult("Server-Disk", True, "Belegung nicht lesbar — Prüfung übersprungen")
70
+ if used >= max_used:
75
71
  return CheckResult(
76
- "Server-Disk", False, f"≥ {max_used} % belegt: {', '.join(full)} — Elasticsearch blockiert ab 90 %"
72
+ "Server-Disk", False, f"Elasticsearch-Daten {used} % belegt (≥ {max_used} %) — Elasticsearch blockiert ab 90 %"
77
73
  )
78
- return CheckResult("Server-Disk", True, f"alle Dateisysteme < {max_used} % belegt")
74
+ return CheckResult("Server-Disk", True, f"Elasticsearch-Daten {used} % belegt (< {max_used} %)")
79
75
 
80
76
 
81
77
  def check_openssl() -> CheckResult:
File without changes