2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

fix bug that REST will return error message if no objection defined

This commit is contained in:
ertaozh 2015-05-18 01:49:26 -04:00
parent 889d0d1a8c
commit 8cdde37902

View File

@ -1470,6 +1470,9 @@ sub defout {
foreach my $l (@$lines) {
if ($l =~ /No responses/) { # handle the case that no output from lsslp command
return;
} elsif ($l =~ /Could not find any object definitions/) {
$json->{info} = $l;
last;
}
if ($l =~ /^Object name: / || $l =~ /^\S+:$/) { # start new node
if ($l =~ /^Object name:\s+(\S+)/) { # handle the output of lsdef -t <type> <obj>
@ -1517,6 +1520,9 @@ sub defout_remove_appended_type {
foreach my $l (@$lines) {
if ($l =~ /^(\S*)\s+\(.*\)$/) { # start new node
push @{$json}, $1;
} elsif ($l =~ /Could not find any object definitions/) {
push @{$json}, $l;
last;
}
}
}
@ -1883,7 +1889,7 @@ sub actionhdl {
} elsif ($paramhash->{'value'}) {
push @args, $urilayers[3]."=".$paramhash->{'value'};
}
if (defined($urilayers[3]) and $urilayers[3] =~ /^account/) {
if ((isPut() or isPost()) and defined($urilayers[3])) {
foreach my $key (keys %$paramhash) {
if (($key ne '') and (exists($paramhash->{$key}))) {
push @args, $key."=".$paramhash->{$key};