2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-15 17:16:10 +00:00

capture retrieve_fd fatal error, log the underlie message

This commit is contained in:
yangsbj
2018-08-26 23:08:25 -04:00
parent ec5b18fe13
commit cc3d317823

View File

@ -8239,7 +8239,13 @@ sub loadsdrcache {
if (!open($fh, "<$file")) {
return (1);
}
$r = retrieve_fd($fh);
eval {
$r = retrieve_fd($fh);
}
if($@){
xCAT::MsgUtils->message("S", "loadsdrcache: Fatal error while retrieving data from $file, $@");
return 1;
}
unless ($r) { close($fh); return 1; }
unless ($r->{xcat_sdrcacheversion} and $r->{xcat_sdrcacheversion} == $cache_version) { close($fh); return 1; } #version mismatch