[pve-devel] [PATCH manager] vzdump: use <name> as a convention for virtual endpoints/groups

Lukas Wagner l.wagner at proxmox.com
Mon Jul 24 13:26:59 CEST 2023


Virtual (or anonymous) endpoints/groups are used for sending
one-off notifications to a target that does not exist in the
config.

VZDump uses this to send out notification mails to those addresses
configured by the `mailto` parameter.

Suggested-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 PVE/VZDump.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 7dc9f31e..2671e3b1 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -501,10 +501,10 @@ sub send_notification {
     my $notification_config = PVE::Notify::read_config();
 
     if ($mailto && scalar(@$mailto)) {
-	# <, >, @ is not allowed in endpoint names, but only it is only
+	# <, >, @ are not allowed in endpoint names, but that is only
 	# verified once the config is serialized. That means that
 	# we can rely on that fact that no other endpoint with this name exists.
-	my $endpoint_name = "mail-to-<" . join(",", @$mailto) . ">";
+	my $endpoint_name = "<mail-to-" . join(",", @$mailto) . ">";
 	$notification_config->add_sendmail_endpoint(
 	    $endpoint_name,
 	    $mailto,
@@ -520,7 +520,7 @@ sub send_notification {
 	    push @$endpoints, $target;
 	}
 
-	$target = "group-$endpoint_name";
+	$target = "<group-$endpoint_name>";
 	$notification_config->add_group(
 	    $target,
 	    $endpoints,
-- 
2.39.2






More information about the pve-devel mailing list