From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-ve-rs] ve-config: avoid panicing if fabric node id does not match expected pattern
Date: Fri, 16 Jan 2026 11:07:31 +0100 [thread overview]
Message-ID: <20260116100731.78318-1-h.laimer@proxmox.com> (raw)
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
randomly ran into this, usually we generate this config, but technically
manually editing it is possible. so we should not panic
proxmox-ve-config/src/sdn/fabric/section_config/node.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/proxmox-ve-config/src/sdn/fabric/section_config/node.rs b/proxmox-ve-config/src/sdn/fabric/section_config/node.rs
index 17d2f0b..e6d41d9 100644
--- a/proxmox-ve-config/src/sdn/fabric/section_config/node.rs
+++ b/proxmox-ve-config/src/sdn/fabric/section_config/node.rs
@@ -79,7 +79,9 @@ impl std::str::FromStr for NodeSectionId {
type Err = anyhow::Error;
fn from_str(value: &str) -> Result<Self, Self::Err> {
- let (fabric_id, node_id) = value.split_once("_").unwrap();
+ let (fabric_id, node_id) = value
+ .split_once("_")
+ .ok_or_else(|| anyhow::anyhow!("node id must be <fabric>_<node>"))?;
Ok(Self {
fabric_id: FabricId::from_string(fabric_id.to_string())?,
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2026-01-16 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 10:07 Hannes Laimer [this message]
2026-01-16 11:28 ` Gabriel Goller
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=20260116100731.78318-1-h.laimer@proxmox.com \
--to=h.laimer@proxmox.com \
--cc=pve-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