;; 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))) (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))))