2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-02 11:37:07 +00:00

Merge pull request #1592 from chenglch/mkconservercf

Add trust_host option in rest api for makeconservercf
This commit is contained in:
zet809 2016-07-28 16:50:37 +08:00 committed by GitHub
commit a3b6420910

View File

@ -223,8 +223,8 @@ my %URIdef = (
PUT => {
desc => "Update conserver configuration for the node {noderange}.",
usage => "|Json Formatted DataBody: {action:on/off}.|$usagemsg{non_getreturn}|",
example => "|Enable the console capability for node1|PUT|/nodes/node1/console {\"action\":\"on\"}||",
cmd => "makeconservercf",
example => "|Enable the console capability for node1|PUT|/nodes/node1/console {\"action\":\"on\", \"trust_host\": \"host\"}||",
cmd => "makeconservercf",
fhandler => \&actionhdl,
outhdler => \&noout,
}
@ -2195,9 +2195,12 @@ sub actionhdl {
} elsif ($params->{'resourcename'} eq "console") {
if ($paramhash->{'action'}) {
my $option = $paramhash->{'action'};
my %op_hash = ('on' => '', 'off' => '-d');
push @args, $op_hash{ $paramhash->{'action'} };
my %action = ('on' => '', 'off' => '-d');
push @args, $action{$paramhash->{'action'}};
if ($paramhash->{'trust_host'}) {
push @args, '-t';
push @args, $paramhash->{'trust_host'};
}
} else {
error("Missed Action.", $STATUS_NOT_FOUND);
}