]> git.proxmox.com Git - pve-network.git/commitdiff
controllers: die if opening network interface config fails
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Nov 2023 10:38:47 +0000 (11:38 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Nov 2023 11:48:24 +0000 (12:48 +0100)
we should not continue in that case..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Network/SDN/Controllers.pm

index 95f33944b5c02dbc6fbce42be60e2f91eae17594..167d3eac6e207d9550abb041390e65d68686a573 100644 (file)
@@ -81,7 +81,7 @@ sub generate_controller_config {
 
     # read main config for physical interfaces
     my $current_config_file = "/etc/network/interfaces";
-    my $fh = IO::File->new($current_config_file);
+    my $fh = IO::File->new($current_config_file) or die "failed to open $current_config_file - $!\n";
     my $interfaces_config = PVE::INotify::read_etc_network_interfaces($current_config_file, $fh);
     $fh->close();