[pve-devel] [PATCH container 2/3] update_lxc_config: sort network devices for consistency

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Jul 28 16:23:18 CEST 2016


---
Otherwise the network interfaces are in random and constantly changing order
in this file.

 src/PVE/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 40475d0..35ce796 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -412,7 +412,7 @@ sub update_lxc_config {
     $raw .= "lxc.rootfs = $dir/rootfs\n";
 
     my $netcount = 0;
-    foreach my $k (keys %$conf) {
+    foreach my $k (sort keys %$conf) {
 	next if $k !~ m/^net(\d+)$/;
 	my $ind = $1;
 	my $d = PVE::LXC::Config->parse_lxc_network($conf->{$k});
-- 
2.1.4




More information about the pve-devel mailing list