]> git.proxmox.com Git - pmg-api.git/blobdiff - src/PMG/ClusterConfig.pm
cluster config: restrict slurp scope to avoid issue parsing network interfaces
[pmg-api.git] / src / PMG / ClusterConfig.pm
index 77b9e60dd9d1d7599f05301e691afcd8c3a93a0b..c52508dc2ecd897e153bc5ebd9f7ce18da562ece 100644 (file)
@@ -170,9 +170,7 @@ sub lock_config {
 sub read_cluster_conf {
     my ($filename, $fh) = @_;
 
-    local $/ = undef; # slurp mode
-
-    my $raw = defined($fh) ? <$fh> : undef;
+    my $raw = defined($fh) ? do { local $/ = undef; <$fh> } : undef;
 
     my $cinfo = PMG::ClusterConfig::Base->parse_config($filename, $raw);