From cc3d317823c727e95d1e9ba5233d203c1368b326 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Sun, 26 Aug 2018 23:08:25 -0400 Subject: [PATCH] capture retrieve_fd fatal error, log the underlie message --- xCAT-server/lib/xcat/plugins/ipmi.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a61bae3c2..902ec3052 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -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