hooks: accolades au lieu de parenthèses (évite ((…)) arithmétique)
1 changed file +2 −2
modified
mld/deploy.py
+2 −2
@@ -121,7 +121,7 @@ def _install_hooks(m, ip, ctx): | ||
| 121 | 121 | if m.get("ka_repo"): |
| 122 | 122 | script += "grep -qx %s ~/.ka-pousseur-repos 2>/dev/null || echo %s >> ~/.ka-pousseur-repos; echo ' pousseur: %s inscrit'\n" % (shlex.quote(m["dir"]), shlex.quote(m["dir"]), m["dir"]) |
| 123 | 123 | for hook in (m.get("hooks") or {}).get("post_sync") or []: |
| 124 | − script += "cd %s && (%s)\n" % (shlex.quote(d), manifest.render(hook, ctx)) | |
| 124 | + script += "cd %s && { %s ; }\n" % (shlex.quote(d), manifest.render(hook, ctx)) | |
| 125 | 125 | return script |
| 126 | 126 | |
| 127 | 127 | |
@@ -211,7 +211,7 @@ def start(app, alias, m=None, ctx=None, ip=None): | ||
| 211 | 211 | ssh.write_remote_file(ip, ppath, pl, mode="644") |
| 212 | 212 | script += "launchctl bootout gui/$(id -u)/%s >/dev/null 2>&1; launchctl bootstrap gui/$(id -u) %s && echo ' launchd: %s chargé' || echo ' launchd: %s ÉCHEC'\n" % (item["label"], shlex.quote(ppath), item["label"], item["label"]) |
| 213 | 213 | for hook in (m.get("hooks") or {}).get("post_start") or []: |
| 214 | − script += "cd %s && (%s)\n" % (shlex.quote(_abs(m["dir"])), manifest.render(hook, ctx)) | |
| 214 | + script += "cd %s && { %s ; }\n" % (shlex.quote(_abs(m["dir"])), manifest.render(hook, ctx)) | |
| 215 | 215 | rc, out, err = ssh.run(ip, script, timeout=300) |
| 216 | 216 | for l in out.splitlines(): |
| 217 | 217 | _log(app, l) |
| 218 | 218 | |