heal : ignorer les apps marquées stopped (arrêt volontaire via mld stop)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 changed file +8 −1
modified
mld/heal.py
+8 −1
@@ -116,6 +116,7 @@ def heal(apps_filter=None, nodes_filter=None, dry_run=False, quiet=False, public | |||||
| 116 | st = _state() | 116 | st = _state() | ||
| 117 | reg = registry.load() | 117 | reg = registry.load() | ||
| 118 | by_node = {} | 118 | by_node = {} | ||
| 119 | + suspended = [] | ||||
| 119 | for app, v in reg["apps"].items(): | 120 | for app, v in reg["apps"].items(): | ||
| 120 | if apps_filter and app not in apps_filter: | 121 | if apps_filter and app not in apps_filter: | ||
| 121 | continue | 122 | continue | ||
@@ -123,9 +124,15 @@ def heal(apps_filter=None, nodes_filter=None, dry_run=False, quiet=False, public | |||||
| 123 | continue | 124 | continue | ||
| 124 | if nodes_filter and v["node"] not in nodes_filter: | 125 | if nodes_filter and v["node"] not in nodes_filter: | ||
| 125 | continue | 126 | continue | ||
| 127 | + if v.get("status") == "stopped": | ||||
| 128 | + # arrêt volontaire (`mld stop`) : on ne ressuscite pas, `mld start` remet online | ||||
| 129 | + suspended.append(app) | ||||
| 130 | + continue | ||||
| 126 | by_node.setdefault(v["node"], {})[app] = manifest.load(app) | 131 | by_node.setdefault(v["node"], {})[app] = manifest.load(app) | ||
| 127 | changes = {} | 132 | changes = {} | ||
| 128 | − summary = {"ok": 0, "fixed": 0, "ko": 0, "skipped": 0} | 133 | + summary = {"ok": 0, "fixed": 0, "ko": 0, "skipped": len(suspended)} | ||
| 134 | + if suspended: | ||||
| 135 | + _log("suspendues (mld stop, ignorées) : %s" % ", ".join(sorted(suspended)), quiet) | ||||
| 129 | tun_state = None | 136 | tun_state = None | ||
| 130 | try: | 137 | try: | ||
| 131 | tun_state = tunnel.state() | 138 | tun_state = tunnel.state() | ||
| 132 | 139 | ||||