public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH network 1/2] prefix specific sdn resource type to existence assertion string
Date: Fri,  3 Jul 2026 12:47:49 +0200	[thread overview]
Message-ID: <20260703104750.117988-2-d.kral@proxmox.com> (raw)
In-Reply-To: <20260703104750.117988-1-d.kral@proxmox.com>

The non-empty assertion strings already prefixed each sdn resource type,
but the existence assertion did not.

This makes error messages more clearer if multiple sdn resources are
provided, e.g. as API parameters by users.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
 src/PVE/Network/SDN/Controllers.pm | 2 +-
 src/PVE/Network/SDN/Dns.pm         | 2 +-
 src/PVE/Network/SDN/Ipams.pm       | 2 +-
 src/PVE/Network/SDN/Zones.pm       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/PVE/Network/SDN/Controllers.pm b/src/PVE/Network/SDN/Controllers.pm
index 4336b86..b2c2f9d 100644
--- a/src/PVE/Network/SDN/Controllers.pm
+++ b/src/PVE/Network/SDN/Controllers.pm
@@ -28,7 +28,7 @@ sub sdn_controllers_config {
     die "no sdn controller ID specified\n" if !$id;
 
     my $scfg = $cfg->{ids}->{$id};
-    die "sdn '$id' does not exist\n" if (!$noerr && !$scfg);
+    die "sdn controller '$id' does not exist\n" if (!$noerr && !$scfg);
 
     return $scfg;
 }
diff --git a/src/PVE/Network/SDN/Dns.pm b/src/PVE/Network/SDN/Dns.pm
index 76833ea..db2f930 100644
--- a/src/PVE/Network/SDN/Dns.pm
+++ b/src/PVE/Network/SDN/Dns.pm
@@ -21,7 +21,7 @@ sub sdn_dns_config {
     die "no sdn dns ID specified\n" if !$id;
 
     my $scfg = $cfg->{ids}->{$id};
-    die "sdn '$id' does not exist\n" if (!$noerr && !$scfg);
+    die "sdn dns '$id' does not exist\n" if (!$noerr && !$scfg);
 
     return $scfg;
 }
diff --git a/src/PVE/Network/SDN/Ipams.pm b/src/PVE/Network/SDN/Ipams.pm
index 00aa20c..179bdf7 100644
--- a/src/PVE/Network/SDN/Ipams.pm
+++ b/src/PVE/Network/SDN/Ipams.pm
@@ -93,7 +93,7 @@ sub sdn_ipams_config {
     die "no sdn ipam ID specified\n" if !$id;
 
     my $scfg = $cfg->{ids}->{$id};
-    die "sdn '$id' does not exist\n" if (!$noerr && !$scfg);
+    die "sdn ipam '$id' does not exist\n" if (!$noerr && !$scfg);
 
     return $scfg;
 }
diff --git a/src/PVE/Network/SDN/Zones.pm b/src/PVE/Network/SDN/Zones.pm
index 4c1468c..f668303 100644
--- a/src/PVE/Network/SDN/Zones.pm
+++ b/src/PVE/Network/SDN/Zones.pm
@@ -35,7 +35,7 @@ sub sdn_zones_config {
     die "no sdn zone ID specified\n" if !$id;
 
     my $scfg = $cfg->{ids}->{$id};
-    die "sdn '$id' does not exist\n" if (!$noerr && !$scfg);
+    die "sdn zone '$id' does not exist\n" if (!$noerr && !$scfg);
 
     return $scfg;
 }
-- 
2.47.3





  reply	other threads:[~2026-07-03 10:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 10:47 [PATCH-SERIES network 0/2] assert vnet zone exists on create and update Daniel Kral
2026-07-03 10:47 ` Daniel Kral [this message]
2026-07-03 10:47 ` [PATCH network 2/2] api: vnets: " Daniel Kral

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=20260703104750.117988-2-d.kral@proxmox.com \
    --to=d.kral@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal