From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 0B7F71FF163 for ; Thu, 7 Nov 2024 15:41:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E05B7320EF; Thu, 7 Nov 2024 15:41:07 +0100 (CET) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Thu, 7 Nov 2024 15:40:54 +0100 Message-Id: <20241107144055.202870-1-d.kral@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.003 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v2 1/2] ui: cloudinit: use cloudinit update api when regenerating images X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Changes the behavior of the "Regenerate Image" button in the VM's CloudInit tab from using the more expensive VM update API endpoint to using the CloudInit update API endpoint. Originally-by: Alexandre Derumier Signed-off-by: Daniel Kral --- Changes since v1 (as suggested by @Fiona): - added this patch to reduce the needed permissions - added a commit message to the applied patch - no changes to the original patch hunk This change has been taken from a previously unapplied commit [0]. I have only applied the changes done to the button handler. The rest of the original patch also touches the functionality of editing the fields, which breaks the check if a cloudinit disk is present, because the cloudinit_pending's response no longer includes the CloudInit disk drive property itself and therefore will always show "No CloudInit drive found". This change could be included in the future, but is not part of my original patch's intention. www/manager6/qemu/CloudInit.js | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js index 49519726..be902d43 100644 --- a/www/manager6/qemu/CloudInit.js +++ b/www/manager6/qemu/CloudInit.js @@ -82,38 +82,16 @@ Ext.define('PVE.qemu.CloudInit', { text: gettext('Regenerate Image'), handler: function() { let view = this.up('grid'); - var eject_params = {}; - var insert_params = {}; - let disk = PVE.Parser.parseQemuDrive(view.ciDriveId, view.ciDrive); - var storage = ''; - var stormatch = disk.file.match(/^([^:]+):/); - if (stormatch) { - storage = stormatch[1]; - } - eject_params[view.ciDriveId] = 'none,media=cdrom'; - insert_params[view.ciDriveId] = storage + ':cloudinit'; - - var failure = function(response, opts) { - Ext.Msg.alert('Error', response.htmlStatus); - }; Proxmox.Utils.API2Request({ - url: view.baseurl + '/config', + url: view.baseurl + '/cloudinit', waitMsgTarget: view, method: 'PUT', - params: eject_params, - failure: failure, + failure: function(response, opts) { + Ext.Msg.alert('Error', response.htmlStatus); + }, callback: function() { - Proxmox.Utils.API2Request({ - url: view.baseurl + '/config', - waitMsgTarget: view, - method: 'PUT', - params: insert_params, - failure: failure, - callback: function() { - view.reload(); - }, - }); + view.reload(); }, }); }, -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel