From b7bd03f151d9fc33a9df20b3e31e82ccdb48fbcf Mon Sep 17 00:00:00 2001 From: chenglch Date: Mon, 19 Mar 2018 11:38:45 +0800 Subject: [PATCH] Fix command error in gocons caused by the env variable In hierarchical mode, xCAT insert variables in the command line, but goconserver do not support this format. This patch put the definition for environment variable to `{params}->{env}` field so that the first argument of `{params}->{cmd}` is executable. --- xCAT-server/lib/perl/xCAT/Goconserver.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 172e1010e..fdbdc4d5b 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -73,17 +73,14 @@ sub gen_request_data { if ($cmeth eq "openbmc") { push @openbmc_nodes, $k; } else { - $cmd = $::XCATROOT . "/share/xcat/cons/$cmeth"." ".$k; - if (!(!$isSN && $v->{conserver} && xCAT::NetworkUtils->thishostisnot($v->{conserver}))) { - my $env; - my $locerror = $isSN ? "PERL_BADLANG=0 " : ''; - if (defined($ENV{'XCATSSLVER'})) { - $env = "XCATSSLVER=$ENV{'XCATSSLVER'} "; - } - $cmd = $locerror.$env.$cmd; + my $env = ""; + my $locerror = $isSN ? "PERL_BADLANG=0 " : ''; + if (defined($ENV{'XCATSSLVER'})) { + $env = "XCATSSLVER=$ENV{'XCATSSLVER'} "; } + $data->{$k}->{params}->{env} = $locerror.$env; $data->{$k}->{driver} = "cmd"; - $data->{$k}->{params}->{cmd} = $cmd; + $data->{$k}->{params}->{cmd} = $::XCATROOT . "/share/xcat/cons/$cmeth"." ".$k; $data->{$k}->{name} = $k; } if (defined($v->{consoleondemand})) {