From 1039462c4476a5734baa2a3c699386c0f481850d Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 27 May 2014 07:46:47 -0400 Subject: [PATCH] xcatws.cgi: fix the output when slpnodes resource has no output; fix the output message for nodestat resource --- xCAT-server/xCAT-wsapi/xcatws.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index c63a2b164..bc29399a4 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -124,7 +124,7 @@ my %URIdef = ( GET => { desc => "Get the running status for the node {noderange}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the running status for node node1|GET|/nodes/node1/nodestat|x|", + example => "|Get the running status for node node1|GET|/nodes/node1/nodestat|{\n \"node1\":{\n \"nodestat\":\"noping\"\n }\n}|", cmd => "nodestat", fhandler => \&actionhdl, outhdler => \&actionout, @@ -1401,6 +1401,9 @@ sub defout { $lines = \@alldata; } foreach my $l (@$lines) { + if ($l =~ /No responses/) { # handle the case that no output from lsslp command + return; + } if ($l =~ /^Object name: / || $l =~ /^\S+:$/) { # start new node if ($l =~ /^Object name:\s+(\S+)/) { # handle the output of lsdef -t $nodename = $1;