[pve-devel] [PATCH pve-manager 2/2] network-interface-pinning: early exit if nothing to do
Stefan Hanreich
s.hanreich at proxmox.com
Fri Jul 18 18:26:10 CEST 2025
We would regenerate all configuration files, even if no interface
would be mapped. While this shouldn't cause an issue, it's
unnecessary, has potential for creating bugs and leads to confusing
output for the users - so just abort in this case instead.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
PVE/CLI/proxmox_network_interface_pinning.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PVE/CLI/proxmox_network_interface_pinning.pm b/PVE/CLI/proxmox_network_interface_pinning.pm
index 8b7127488..382e2d94b 100644
--- a/PVE/CLI/proxmox_network_interface_pinning.pm
+++ b/PVE/CLI/proxmox_network_interface_pinning.pm
@@ -398,6 +398,11 @@ __PACKAGE__->register_method({
$prefix,
);
+ if (!$mapping->%*) {
+ print "Nothing to do, aborting.\n";
+ exit 0;
+ }
+
for my $old_name (sort keys $mapping->%*) {
print "Name for link '$old_name' will change to '$mapping->{$old_name}'\n";
}
--
2.39.5
More information about the pve-devel
mailing list