From patchwork Tue Jan 7 00:28:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 36694 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6851E27BBEA; Tue, 7 Jan 2025 00:29:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5F89C27BBE2 for ; Tue, 7 Jan 2025 00:29:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUxSz-00027j-Ue; Mon, 06 Jan 2025 19:29:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUxSy-00027F-EG for guix-patches@gnu.org; Mon, 06 Jan 2025 19:29:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUxSy-0004rb-5y for guix-patches@gnu.org; Mon, 06 Jan 2025 19:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=pn3GUGQcm7v5aTbG/shfs+SKgPfY705W9oGwU9QgkUs=; b=tsgsR89GQS+X5MCfrHZDS/M0Btr99+hRcgL2T99UrUPJR7aoP4Rx3y2fDMvWgRsNw6bUwhawqMyG2pcsPpjLzFPUtWoCPdBTpgeHZuJYJikra5P10oe1wMJuRK4aHM+Sj82Q2LQb21ZYg7jznwR+uo5mFebu2HxIxAMAzKKoAO1Xu7R1nnOjJwNLLjLefj8WMkNOs5v70WfxiX8Br+xbg5iNmJy02Imdblc7ZO9GxCIJfUv1k85uf085k7aTz3JFwUVao/9X2LNeO9/mrhxSxxUYNqnyxg9a1aMCuWXa1XYRwI4FKEtOrwe01mJXOvHiWhBP9NI5YtScPu4tgoOMsA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUxSw-00041q-NT; Mon, 06 Jan 2025 19:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75414] [PATCH 1/2] machine: ssh: Return monadic value from roll-back-managed-host. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: arunisaac@systemreboot.net, guix-patches@gnu.org Resent-Date: Tue, 07 Jan 2025 00:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75414 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75414@debbugs.gnu.org Cc: Arun Isaac , Arun Isaac X-Debbugs-Original-Xcc: Arun Isaac Received: via spool by 75414-submit@debbugs.gnu.org id=B75414.173620974115468 (code B ref 75414); Tue, 07 Jan 2025 00:29:02 +0000 Received: (at 75414) by debbugs.gnu.org; 7 Jan 2025 00:29:01 +0000 Received: from localhost ([127.0.0.1]:41042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUxSu-00041M-Qi for submit@debbugs.gnu.org; Mon, 06 Jan 2025 19:29:01 -0500 Received: from mugam.systemreboot.net ([139.59.75.54]:50610) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUxSr-00040q-9W for 75414@debbugs.gnu.org; Mon, 06 Jan 2025 19:28:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemreboot.net; s=default; t=1736209728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=koPhJjsCT+WcG3YD0Y2UK8kA1x0JuaZMkZWun8KekNg=; b=XW74GDVfyx79iiNfOXtEUdsYaZMYYhZczvSajWZcqV2F0fiVppNLyaWYLPAk21ZIPzOZb5 FqpSscCU0Br48MRtMHzEoZi+RX1Lsziqi+Gj7M533HacCLHWhePwfbCduNRWG/MJIoFvRL 6D2B0TIAV63EIMFHmXNipUKkvJ1+d0JOPQtS4cxZV2dLl6UOYmzMGB4+ZVh8j4COOGJED9 IxJqXg9ExAF+muW68pSd/bjLHomTI4q2e+FvkOUQ12rXdEOVg/4e0ee2wWquhB/i95wzN5 pAyHsFbA0RI1hqykFdY4XXXp5KZWjTIW2h9zor0HlBxnuWQYqD149cjkaBq/og== Received: from localhost.localdomain ( [192.168.2.1]) by mugam.systemreboot.net (OpenSMTPD) with ESMTPSA id 00ab12d9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 7 Jan 2025 00:28:47 +0000 (UTC) From: Arun Isaac Date: Tue, 7 Jan 2025 00:28:30 +0000 Message-ID: <9d154b115a6a1bb7a7fb0cc24d1bd8c90a1437ab.1736208948.git.arunisaac@systemreboot.net> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Previously, 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 ;;; Copyright © 2020-2024 Ludovic Courtès ;;; Copyright © 2024 Ricardo +;;; Copyright © 2025 Arun Isaac ;;; ;;; 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)))) ;;;