;; Cleaning-up here is a bit tricky, as `deploy-machine' returns a monadic ;; value immediately, to be executed later; this means the clean-up must be ;; delayed until monadic evaluation time. (let* ((server (or server (hetzner-machine-provision machine))) (delegate-machine (hetzner-machine-delegate machine server))) ;; FIXME: The clean-up in the guard does not run even when ;; `deploy-machine' fails. (guard (c (#t ;(cleanup-temporary-ssh-key/maybe api ssh-key) (raise c))) (mlet %store-monad ((value (deploy-machine delegate-machine))) ; (cleanup-temporary-ssh-key/maybe api ssh-key) (return value)))))