From d3a92ba77ef48a7230f35a06ad5b28a75b5815c3 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 17 Nov 2011 11:22:46 +0100 Subject: [PATCH] avoid warning --- data/PVE/Cluster.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm index 16cea0b..8378ca6 100644 --- a/data/PVE/Cluster.pm +++ b/data/PVE/Cluster.pm @@ -720,7 +720,7 @@ sub create_rrd_graph { sub get_config { my ($path) = @_; - return &$ipcc_get_config($path); + return &$ipcc_get_config($path); } sub get_cluster_log { @@ -751,8 +751,9 @@ my $ccache_read = sub { my $ci = $ccache->{$filename}; - if (!$ci->{version} || $ci->{version} != $version) { - + if (!$ci->{version} || !$version || $ci->{version} != $version) { + # we always call the parser, even when the file does not exists + # (in that case $data is undef) my $data = get_config($filename); $ci->{data} = &$parser("/etc/pve/$filename", $data); $ci->{version} = $version; -- 2.39.5