Signed-off-by: Hannes Laimer <[email protected]>
---
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
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to