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.hanre...@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 30815d3a1..b37bd28e0 100644
--- a/PVE/CLI/proxmox_network_interface_pinning.pm
+++ b/PVE/CLI/proxmox_network_interface_pinning.pm
@@ -381,6 +381,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


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to