unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Arun Isaac <arunisaac@systemreboot.net>
To: 75414@debbugs.gnu.org
Cc: Arun Isaac <arunisaac@systemreboot.net>,
	Arun Isaac <arunisaac@systemreboot.net>
Subject: [bug#75414] [PATCH 1/2] machine: ssh: Return monadic value from roll-back-managed-host.
Date: Tue,  7 Jan 2025 00:28:30 +0000	[thread overview]
Message-ID: <9d154b115a6a1bb7a7fb0cc24d1bd8c90a1437ab.1736208948.git.arunisaac@systemreboot.net> (raw)
In-Reply-To: <cover.1736208948.git.arunisaac@systemreboot.net>

Previously, <unspecified> would be returned. That was a bug. Monadic
procedures must always return monadic values.

* gnu/machine/ssh.scm (roll-back-managed-host): Return monadic value.

Change-Id: I3db2879dbfbcab5e9d251fa5ed02c8653adbeafb
---
 gnu/machine/ssh.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index bc4289ef7d..73d5dc513e 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
 ;;; Copyright © 2020-2024 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2024 Ricardo <rekado@elephly.net>
+;;; Copyright © 2025 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -621,8 +622,9 @@ (define (roll-back-managed-host machine)
                                   #:store-directory-prefix store-dir
                                   #:old-entries old-entries)))
                        (remote-result (machine-remote-eval machine remote-exp)))
-    (when (eqv? 'error remote-result)
-      (raise roll-back-failure))))
+    (if (eqv? 'error remote-result)
+        (raise roll-back-failure)
+        (return remote-result))))
 
 \f
 ;;;
-- 
2.47.1





  reply	other threads:[~2025-01-07  0:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-07  0:18 [bug#75414] [PATCH 0/2] Add roll-back action to guix deploy Arun Isaac
2025-01-07  0:28 ` Arun Isaac [this message]
2025-01-07  0:28 ` [bug#75414] [PATCH 2/2] deploy: Add roll-back action Arun Isaac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d154b115a6a1bb7a7fb0cc24d1bd8c90a1437ab.1736208948.git.arunisaac@systemreboot.net \
    --to=arunisaac@systemreboot.net \
    --cc=75414@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).