From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] api-types: resource: fix storage identifier
Date: Tue, 2 Dec 2025 15:38:06 +0100 [thread overview]
Message-ID: <20251202143809.475821-1-s.hanreich@proxmox.com> (raw)
Storages in PVE are uniquely identified by their name and the node
they reside on. The current method only includes the name of the
storage, not the node. Since the ID method is used in the UI for
generating the deep URLs to the respective PVE resources, the
generated URLs are wrong.
The generated global ID is correct, because the map_pve_storage
function uses the id field returned by the PVE API directly, which
includes the node name already.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
lib/pdm-api-types/src/resource.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs
index af3a211e..93f8bd2a 100644
--- a/lib/pdm-api-types/src/resource.rs
+++ b/lib/pdm-api-types/src/resource.rs
@@ -36,7 +36,7 @@ impl Resource {
/// `qemu/<vmid>`
pub fn id(&self) -> String {
match self {
- Resource::PveStorage(r) => format!("storage/{}", r.storage),
+ Resource::PveStorage(r) => format!("storage/{}/{}", r.node, r.storage),
Resource::PveQemu(r) => format!("qemu/{}", r.vmid),
Resource::PveLxc(r) => format!("lxc/{}", r.vmid),
Resource::PveNode(r) => format!("node/{}", r.node),
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next reply other threads:[~2025-12-02 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 14:38 Stefan Hanreich [this message]
2025-12-02 15:33 ` [pdm-devel] applied: " Thomas Lamprecht
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251202143809.475821-1-s.hanreich@proxmox.com \
--to=s.hanreich@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox