From b2e6f56cb0a2b69538b99bf975c3ae348a08e932 Mon Sep 17 00:00:00 2001 From: bxuxa Date: Wed, 27 Mar 2019 13:46:14 +0800 Subject: [PATCH] handle the case when conserver is not available --- xCAT-server/lib/xcat/plugins/conserver.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 220b1b56d..4a6a7b2fc 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -212,10 +212,16 @@ sub process_request { } else { my $rsp->{data}->[0] = "makeconservercf is deprecrated as well as conserver, go to makegocons for more information about enabling goconserver."; xCAT::MsgUtils->message("W", $rsp, $cb); + xCAT::Goconserver::switch_conserver($cb) if (-x "/usr/sbin/conserver"); } - xCAT::Goconserver::switch_conserver($cb); } - makeconservercf($req, $cb); + if (-x "/usr/sbin/conserver") { + makeconservercf($req, $cb); + } else { + my $rsp->{data}->[0] = "conserver is not supported or not installed."; + xCAT::MsgUtils->message("E", $rsp, $cb); + return; + } } }