From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 407C59DD5A for ; Tue, 6 Jun 2023 11:20:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2092432343 for ; Tue, 6 Jun 2023 11:20:47 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 6 Jun 2023 11:20:46 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2D8B448C62 for ; Tue, 6 Jun 2023 11:20:46 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Tue, 6 Jun 2023 11:20:45 +0200 Message-Id: <20230606092045.1782511-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox-backup] ui: tape: fix restore datastore mapping parameter construction X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2023 09:20:47 -0000 We recently took into account the selected datastore when restoring from tape, but the snapshot grids value may not only be a single datastore, it can also be a list of snapshots, datastores or 'all'. handle these cases and extract the source datastore correctly. This fixes tape restoration when not a whole datastore is selected. Reported in the forum: https://forum.proxmox.com/threads/restore-from-lto-parameter-verification-errors-store.128445 Fixes: df881ed0 ("ui: tape: fix restoring a single datastore") Signed-off-by: Dominik Csapak --- this patch should also apply cleanly on the stable-2 branch currently www/tape/window/TapeRestore.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js index 2ff7c4dd..c1d3493c 100644 --- a/www/tape/window/TapeRestore.js +++ b/www/tape/window/TapeRestore.js @@ -380,6 +380,19 @@ Ext.define('PBS.TapeManagement.TapeRestoreWindow', { if (values.store.toString() !== "") { if (vm.get('singleDatastore')) { let source = controller.lookup('snapshotGrid').getValue(); + if (source === 'all') { + // all values are selected + source = values.store; + } else if (Ext.isArray(source)) { + if (source[0].indexOf(':') !== -1) { + // one or multiple snapshots are selected + // extract datastore from first + source = source[0].split(':')[0]; + } else { + // one whole datstore is selected + source = source[0]; + } + } datastores.push(`${source}=${values.store}`); } else { datastores.push(values.store); -- 2.30.2