bugfix: comprehensive stability audit and fixes

- discover/docker.py: handle comma-separated compose_file in labels
- discover/network.py: replace os.getlogin() with robust user detection
- target.py: add lsb_release fallback via hostnamectl, guard None compose_file,
  use container name (not cached CID) for docker logs
- main.py: call reset_state(mode='target') before target mode,
  improve EOF handling info message
- source.py: remove redundant set_stage('DONE') inside transfer_offer
- transfer.py: fix stage naming for resume after transfer
- add dry_run.py for local logic validation
This commit is contained in:
2026-05-22 20:58:37 +04:00
parent 6f3637795b
commit 97b3623915
5 changed files with 205 additions and 27 deletions
+12
View File
@@ -74,6 +74,18 @@ def get_compose_file_from_container(inspect):
if compose_file and os.path.isfile(compose_file):
return compose_file
# Если labels содержит несколько файлов через запятую — берём первый существующий
if compose_file and ", " in compose_file:
for fp in compose_file.split(", "):
fp = fp.strip()
if os.path.isfile(fp):
return fp
elif compose_file and "," in compose_file:
for fp in compose_file.split(","):
fp = fp.strip()
if os.path.isfile(fp):
return fp
# Fallback: ищем docker-compose.yml / compose.yml рядом с working_dir
if working_dir and os.path.isdir(working_dir):
for fname in ("docker-compose.yml", "docker-compose.yaml", "compose.yml", "compose.yaml"):