2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-26 13:10:35 +00:00

fix bug for PUT and POST attributwes of serviceprocessor object in RESTAPI

This commit is contained in:
ertaozh
2015-05-18 04:58:22 -04:00
parent a08d3b3aad
commit 2409539774

View File

@@ -1886,13 +1886,14 @@ sub actionhdl {
} elsif ($params->{'resourcename'} eq "serviceprocessor") {
if (isGET()) {
push @args, $urilayers[3];
} elsif ($paramhash->{'value'}) {
push @args, $urilayers[3]."=".$paramhash->{'value'};
}
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};
} elsif (isPut() or isPost()) {
if ($paramhash->{'value'} and defined($urilayers[3])) {
push @args, $urilayers[3]."=".$paramhash->{'value'};
} else {
foreach my $key (keys %$paramhash) {
if (($key ne '') and (exists($paramhash->{$key}))) {
push @args, $key."=".$paramhash->{$key};
}
}
}
}