fix(sftp): nach erfolgreichem Test als erreichbar anzeigen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0a317e2aa9
commit
4369faf144
@@ -9,6 +9,8 @@ Die Version steht an genau einer Stelle: `src/netmover/__init__.py`.
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Geändert
|
### Geändert
|
||||||
|
- SFTP-Anbindungen gelten nach erfolgreichem Test als „erreichbar“ (vorher bis
|
||||||
|
zum ersten Regellauf „nicht geprüft“).
|
||||||
- Klartext-Hinweis bei `mount error(95)` (keine gemeinsame SMB-Version) mit
|
- Klartext-Hinweis bei `mount error(95)` (keine gemeinsame SMB-Version) mit
|
||||||
Synology-Einstellung; aufgefallen bei der Anbindung des echten NAS.
|
Synology-Einstellung; aufgefallen bei der Anbindung des echten NAS.
|
||||||
|
|
||||||
|
|||||||
@@ -507,6 +507,11 @@ class MountManager:
|
|||||||
if cfg.type is MountType.SFTP and m.host_key is None and report.can_read:
|
if cfg.type is MountType.SFTP and m.host_key is None and report.can_read:
|
||||||
m.host_key = report.host_key
|
m.host_key = report.host_key
|
||||||
event(log, "sftp.host_key_pinned", mount=m.name, fp=report.host_key_fingerprint)
|
event(log, "sftp.host_key_pinned", mount=m.name, fp=report.host_key_fingerprint)
|
||||||
|
# SFTP hat keinen Mount-Zustand – ein erfolgreicher Test heißt „erreichbar“.
|
||||||
|
if cfg.type is MountType.SFTP and report.ok and m.state is not MountState.MOUNTED:
|
||||||
|
m.state = MountState.MOUNTED
|
||||||
|
m.state_since = utcnow()
|
||||||
|
m.last_error = None
|
||||||
|
|
||||||
# -- Lebenszeichen und Wiederherstellung --------------------------------------
|
# -- Lebenszeichen und Wiederherstellung --------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,8 @@ def test_manager_pins_host_key_and_checks_alive(
|
|||||||
with session_factory() as s:
|
with session_factory() as s:
|
||||||
mm = s.get(Mount, mid)
|
mm = s.get(Mount, mid)
|
||||||
assert mm is not None and mm.host_key == server.host_key_string
|
assert mm is not None and mm.host_key == server.host_key_string
|
||||||
|
# Praxisbefund: nach erfolgreichem Test „erreichbar“ statt „nicht geprüft“
|
||||||
|
assert mm.state is MountState.MOUNTED
|
||||||
|
|
||||||
assert manager.check_alive(mid) is None
|
assert manager.check_alive(mid) is None
|
||||||
with session_factory() as s:
|
with session_factory() as s:
|
||||||
|
|||||||
Reference in New Issue
Block a user