scan partiel : fusion dans le cache existant (évite « tout hors ligne » après mld scan X)
1 changed file +3 −1
modified
mld/nodes.py
+3 −1
@@ -130,7 +130,9 @@ def scan(aliases=None, verbose=True): | |||||
| 130 | discover(verbose=False) | 130 | discover(verbose=False) | ||
| 131 | lan = load_lan() | 131 | lan = load_lan() | ||
| 132 | targets = [(a, ip) for a, ip in lan["ips"].items() if not aliases or a in aliases] | 132 | targets = [(a, ip) for a, ip in lan["ips"].items() if not aliases or a in aliases] | ||
| 133 | − res = {} | 133 | + # scan partiel (`mld scan X`) : on FUSIONNE dans le cache existant au lieu de marquer les autres nœuds hors ligne | ||
| 134 | + # (sinon `mld deploy` juste après voyait tout le cluster « hors ligne ») | ||||
| 135 | + res = load_scan() if aliases else {} | ||||
| 134 | with ThreadPoolExecutor(max_workers=24) as ex: | 136 | with ThreadPoolExecutor(max_workers=24) as ex: | ||
| 135 | for info in ex.map(lambda t: probe(*t), targets): | 137 | for info in ex.map(lambda t: probe(*t), targets): | ||
| 136 | res[info["alias"]] = info | 138 | res[info["alias"]] = info | ||
| 137 | 139 | ||||