[pve-devel] [PATCH common 2/4] network parser: iterate deterministically

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Dec 21 16:30:23 CET 2023


makes the behaviour easier to analyze, and also helps when testing since it
allows constructing test cases that trigger certain order of parsing.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/PVE/INotify.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index bc33a8f..601e651 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1030,7 +1030,7 @@ sub __read_etc_network_interfaces {
 	};
     }
 
-    foreach my $iface (keys %$ifaces) {
+    foreach my $iface (sort keys %$ifaces) {
 	my $d = $ifaces->{$iface};
 	$d->{type} = 'unknown';
 	if ($iface =~ m/^bond\d+$/) {
-- 
2.39.2





More information about the pve-devel mailing list