2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-24 05:11:12 +00:00

Merge pull request #4912 from robin2008/message-no-py-agent

When xCAT-openbmc-py is not installed on Service Node, log does not help describe the problem
This commit is contained in:
zet809
2018-03-09 15:34:44 +08:00
committed by GitHub
2 changed files with 11 additions and 4 deletions

View File

@@ -69,11 +69,14 @@ sub acquire_lock {
flock($lock_fd, LOCK_EX) or return undef;
return $lock_fd;
}
sub start_python_agent {
if (! -e $PYTHON_AGENT_FILE) {
xCAT::MsgUtils->message("S", "start_python_agent() Error: '$PYTHON_AGENT_FILE' does not exist");
return undef;
sub exists_python_agent {
if ( -e $PYTHON_AGENT_FILE) {
return 1;
}
return 0;
}
sub start_python_agent {
if (!defined(acquire_lock())) {
xCAT::MsgUtils->message("S", "start_python_agent() Error: Failed to acquire lock");

View File

@@ -117,6 +117,10 @@ sub process_request {
my $request = shift;
$callback = shift;
if (!xCAT::OPENBMC::exists_python_agent()) {
xCAT::MsgUtils->message("E", { data => ["The xCAT Python agent does not exist. Check if xCAT-openbmc-py package is installed on management node and service nodes."] }, $callback);
return;
}
# If we can't start the python agent, exit immediately
my $pid = xCAT::OPENBMC::start_python_agent();
if (!defined($pid)) {