Fix remote rrdtool_check_rrd_exists() calls (#4196)

It was comparing with the full name when rrdcached only printed out the relative name.
Thanks mikmak on irc for lots of troubleshooting.
This commit is contained in:
Tony Murray
2016-08-24 16:42:50 -05:00
committed by Neil Lathwood
parent 1055003d3f
commit 111d967e7d

View File

@@ -260,7 +260,8 @@ function rrdtool_check_rrd_exists($filename)
global $config;
if ($config['rrdcached'] && version_compare($config['rrdtool_version'], '1.5', '>=')) {
$chk = rrdtool('last', $filename, '');
return strpos(implode($chk), "$filename': No such file or directory") === false;
$filename = str_replace(array($config['rrd_dir'].'/', $config['rrd_dir']), '', $filename);
return !str_contains(implode($chk), "$filename': No such file or directory");
} else {
return is_file($filename);
}