From 6aadfc2055bb4d92fe429f75611506547b103f19 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 27 Jul 2017 16:08:14 +0800 Subject: [PATCH 1/5] Fix 3474, introduce 'XCATSHOWSVR' to control whether to show where the message is from. --- perl-xCAT/xCAT/Client.pm | 64 +++++++++++++++++++++++++--------------- xCAT-server/sbin/xcatd | 16 ++++++++++ 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index d7df0a9fc..ae0d19d98 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -1129,6 +1129,13 @@ sub handle_response { return; } + my $msgsource; + if ($ENV{'XCATSHOWSVR'}) { + unless ($rsp->{NoSvrPrefix}) { # some plugins could disable the prefix forcely by seting the flag in response. + $msgsource = $rsp->{xcatdsource}->[0] if ($rsp->{xcatdsource}); + } + } + #print "in handle_response\n"; # Handle errors if (defined($rsp->{errorcode})) { @@ -1141,24 +1148,23 @@ sub handle_response { $xCAT::Client::EXITCODE |= $rsp->{errorcode}; } # assume it is a non-reference scalar } + if ($rsp->{error}) { #print "printing error\n"; if (ref($rsp->{error}) eq 'ARRAY') { foreach my $text (@{ $rsp->{error} }) { - if ($rsp->{NoErrorPrefix}) { - print STDERR "$text\n"; - } else { - print STDERR "Error: $text\n"; - } + my $desc = "$text"; + $desc = "[$msgsource]: $desc" if ($msgsource && $desc); + $desc = "Error: $desc" unless ($rsp->{NoErrorPrefix}); + print STDERR "$desc\n"; } } else { - if ($rsp->{NoErrorPrefix}) { - print STDERR ($rsp->{error} . "\n"); - } else { - print STDERR ("Error: " . $rsp->{error} . "\n"); - } + my $desc = $rsp->{error}; + $desc = "[$msgsource]: $desc" if ($msgsource && $desc); + $desc = "Error: $desc" unless ($rsp->{NoErrorPrefix}); + print STDERR "$desc\n"; } } if ($rsp->{warning}) { @@ -1166,19 +1172,17 @@ sub handle_response { #print "printing warning\n"; if (ref($rsp->{warning}) eq 'ARRAY') { foreach my $text (@{ $rsp->{warning} }) { - if ($rsp->{NoWarnPrefix}) { - print STDERR "$text\n"; - } else { - print STDERR "Warning: $text\n"; - } + my $desc = "$text"; + $desc = "[$msgsource]: $desc" if ($msgsource && $desc); + $desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix}); + print STDERR "$desc\n"; } } else { - if ($rsp->{NoWarnPrefix}) { - print STDERR ($rsp->{warning} . "\n"); - } else { - print STDERR ("Warning: " . $rsp->{warning} . "\n"); - } + my $desc = $rsp->{warning}; + $desc = "[$msgsource]: $desc" if ($msgsource && $desc); + $desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix}); + print STDERR "$desc\n"; } } if ($rsp->{info}) { @@ -1186,11 +1190,15 @@ sub handle_response { #print "printing info\n"; if (ref($rsp->{info}) eq 'ARRAY') { foreach my $text (@{ $rsp->{info} }) { - print "$text\n"; + my $desc = "$text"; + $desc = "[$msgsource]: $desc" if ($msgsource && $desc); + print "$desc\n"; } } else { - print($rsp->{info} . "\n"); + my $desc = $rsp->{info}; + $desc = "[$msgsource]: $desc" if ($msgsource && $desc); + print "$desc\n"; } } @@ -1224,6 +1232,11 @@ sub handle_response { } else { $desc = $node->{name}; } + if ($desc) { + $desc = "$desc: [$msgsource]" if ($msgsource); + } else { + $desc = "[$msgsource]" if ($msgsource); + } if ($node->{errorcode}) { if (ref($node->{errorcode}) eq 'ARRAY') { foreach my $ecode (@{ $node->{errorcode} }) { @@ -1274,7 +1287,7 @@ sub handle_response { if ($node->{base64_data}) { $desc = $desc . ": " . decode_base64($node->{base64_data}->[0]); } - if ($desc) { + if ($desc && $desc ne "[$msgsource]") { if ($errflg == 1) { print STDERR ("$desc\n"); } else { @@ -1306,7 +1319,10 @@ sub handle_response { } } } - if ($desc) { print "$desc\n"; } + if ($desc) { + $desc = "[$msgsource]: $desc" if ($msgsource); + print "$desc\n"; + } } } } # end of handle_response diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index cc8303261..e462ce99a 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -940,6 +940,9 @@ unless ($foreground) { daemonize; } +my @hostinfo = xCAT::NetworkUtils->determinehostname(); +my $XCATSERVER = $hostinfo[-1]; + $dbmaster = xCAT::Table::init_dbworker; if ($enable_perf) { xCAT::MsgUtils->perf_log_process( "db", undef, "dbprocess", $dbmaster ); @@ -2585,8 +2588,21 @@ sub send_response { if ($encode eq "xml") { my $xml; if ($response->{xcatresponse}) { # it's an aggregate, keeproot + if ($XCATSERVER) { + my $rsp = $response->{xcatresponse}; + if ( (ref($rsp) eq 'ARRAY') && scalar(@$rsp) > 0 ) { + foreach (@$rsp) { + $_->{xcatdsource}->[0] = $XCATSERVER unless ($_->{xcatdsource}); + } + } + } $xml = XMLout($response, KeyAttr => [], NoAttr => 1, KeepRoot => 1); } else { + if ($XCATSERVER) { + unless (exists($response->{serverdone})) { + $response->{xcatdsource}->[0] = $XCATSERVER; + } + } $xml = XMLout($response, RootName => 'xcatresponse', NoAttr => 1); } $xml =~ tr/\011-\177/?/c; From cf9fd117a8be3412a746aaf4967456c35d371365 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Mon, 31 Jul 2017 13:49:45 +0800 Subject: [PATCH 2/5] Update nodeset manpage for XCATSHOWSVR, with this environment variable the output will have server name information. --- .../guides/admin-guides/references/man8/nodeset.8.rst | 10 +++++++++- xCAT-client/pods/man8/nodeset.8.pod | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst index 35edfcd45..f4674c226 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -40,10 +40,16 @@ changing the network boot files. Each xCAT node always boots from the network and downloads a boot file with instructions on what action to take next. -\ **nodeset**\ will manipulate the boot configuration files of yaboot and pxelinux.0. +\ **nodeset**\ will manipulate the boot configuration files of xnba, grub2, petitboot, yaboot and pxelinux.0. Assume that /tftpboot is the root for tftpd (set in site(5)|site.5). +\ **nodeset**\ for petitboot makes changes to /tftpboot/petitboot/{node name} + +\ **nodeset**\ for xnba makes changes to /tftpboot/xcat/xnba/nodes/{node name} + +\ **nodeset**\ for grub2 makes changes to /tftpboot/boot/grub2/{node name} + \ **nodeset**\ for pxe makes changes to /tftpboot/pxelinux.cfg/{node hex ip} \ **nodeset**\ for yaboot makes changes to /tftpboot/etc/{node hex ip} @@ -53,6 +59,8 @@ Assume that /tftpboot is the root for tftpd (set in site(5)|site.5). \ **nodeset**\ is called by \ **rinstall**\ and \ **winstall**\ and is also called by the installation process remotely to set the boot state back to "boot". +In a hierarchical cluster which managed by service nodes, the boot stat of the nodes should be kept in consistence on the mn and on the service nodes. Then \ **nodeset**\ command is required to be dispatched to the service nodes for handling the boot configuration files. There are multiple messages for one node from service nodes, it is hard to tell where is the problem from. To make the output more clear, user could run the command with "XCATSHOWSVR=1" environment variable, and then the output message will be appended with the server information. + A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index 15618d46d..7934a2d9c 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -21,10 +21,16 @@ changing the network boot files. Each xCAT node always boots from the network and downloads a boot file with instructions on what action to take next. -B will manipulate the boot configuration files of yaboot and pxelinux.0. +B will manipulate the boot configuration files of xnba, grub2, petitboot, yaboot and pxelinux.0. Assume that /tftpboot is the root for tftpd (set in L). +B for petitboot makes changes to /tftpboot/petitboot/{node name} + +B for xnba makes changes to /tftpboot/xcat/xnba/nodes/{node name} + +B for grub2 makes changes to /tftpboot/boot/grub2/{node name} + B for pxe makes changes to /tftpboot/pxelinux.cfg/{node hex ip} B for yaboot makes changes to /tftpboot/etc/{node hex ip} @@ -34,6 +40,8 @@ B only sets the next boot state, but does not reboot. B is called by B and B and is also called by the installation process remotely to set the boot state back to "boot". +In a hierarchical cluster which managed by service nodes, the boot stat of the nodes should be kept in consistence on the mn and on the service nodes. Then B command is required to be dispatched to the service nodes for handling the boot configuration files. There are multiple messages for one node from service nodes, it is hard to tell where is the problem from. To make the output more clear, user could run the command with "XCATSHOWSVR=1" environment variable, and then the output message will be appended with the server information. + A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. From c008a1686e4c1fb08412ff38e4cebde10c0fd69a Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 1 Aug 2017 13:43:13 +0800 Subject: [PATCH 3/5] Adopted review comments and made changes as below: - use -V/--verbose to enable the XCATSHOWSVR, it is more straitforward to user. - refine the manpage based on Mark's comments. --- .../guides/admin-guides/references/man8/nodeset.8.rst | 10 ++++++++-- xCAT-client/bin/rinstall | 9 +++++++++ xCAT-client/bin/updatenode | 9 +++++++++ xCAT-client/bin/xcatclient | 9 +++++++++ xCAT-client/bin/xcatclientnnr | 9 +++++++++ xCAT-client/pods/man8/nodeset.8.pod | 8 ++++++-- 6 files changed, 50 insertions(+), 4 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst index f4674c226..1186b8b91 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -19,7 +19,7 @@ Name **************** -\ **nodeset**\ \ *noderange*\ [\ **boot**\ | \ **stat**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\ | \ **shutdown**\ ] +\ **nodeset**\ \ *noderange*\ [\ **boot**\ | \ **stat**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\ | \ **shutdown**\ ] [\ **-V | -**\ **-verbose**\ ] \ **nodeset**\ \ *noderange*\ \ **osimage**\ [=\ *imagename*\ ] [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] @@ -59,7 +59,7 @@ Assume that /tftpboot is the root for tftpd (set in site(5)|site.5). \ **nodeset**\ is called by \ **rinstall**\ and \ **winstall**\ and is also called by the installation process remotely to set the boot state back to "boot". -In a hierarchical cluster which managed by service nodes, the boot stat of the nodes should be kept in consistence on the mn and on the service nodes. Then \ **nodeset**\ command is required to be dispatched to the service nodes for handling the boot configuration files. There are multiple messages for one node from service nodes, it is hard to tell where is the problem from. To make the output more clear, user could run the command with "XCATSHOWSVR=1" environment variable, and then the output message will be appended with the server information. +In a hierarchical cluster managed by service nodes, \ **nodeset**\ command is used to make sure compute node states are consistent on service and management nodes. When errors are reported, run the command with verbose mode. And the command will display additional service node information, which might be useful in identifying the problem. A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. @@ -133,6 +133,12 @@ A user can supply their own scripts to be run on the mn or on the service node ( +\ **-V | -**\ **-verbose**\ + + Verbose mode. + + + \ **-h | -**\ **-help**\ Print help. diff --git a/xCAT-client/bin/rinstall b/xCAT-client/bin/rinstall index 9d989a2e7..0a69b158f 100755 --- a/xCAT-client/bin/rinstall +++ b/xCAT-client/bin/rinstall @@ -67,6 +67,15 @@ push(@{ $cmdref->{arg} }, @ARGV); my $noderange = $cmdref->{noderange}->[0]; # save the noderange +# Allow to print server information when -V/--verbose +foreach (reverse(@ARGV)) { + print $_; + if ($_ eq '-V' || $_ eq '--verbose') { + $ENV{'XCATSHOWSVR'} = 1; + last; + } +} + # ok call Client to run the plugin rinstall.pm xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response); diff --git a/xCAT-client/bin/updatenode b/xCAT-client/bin/updatenode index 17e52db8e..bb7ddd80a 100755 --- a/xCAT-client/bin/updatenode +++ b/xCAT-client/bin/updatenode @@ -200,5 +200,14 @@ foreach (keys %ENV) { } } +# Allow to print server information when -V/--verbose +foreach (reverse(@ARGV)) { + print $_; + if ($_ eq '-V' || $_ eq '--verbose') { + $ENV{'XCATSHOWSVR'} = 1; + last; + } +} + xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response); exit $xCAT::Client::EXITCODE; diff --git a/xCAT-client/bin/xcatclient b/xCAT-client/bin/xcatclient index 83a918941..c59f59685 100755 --- a/xCAT-client/bin/xcatclient +++ b/xCAT-client/bin/xcatclient @@ -102,5 +102,14 @@ foreach (keys %ENV) { } } +# Allow to print server information when -V +foreach (reverse(@ARGV)) { + print $_; + if ($_ eq '-V') { + $ENV{'XCATSHOWSVR'} = 1; + last; + } +} + xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response); exit $xCAT::Client::EXITCODE; diff --git a/xCAT-client/bin/xcatclientnnr b/xCAT-client/bin/xcatclientnnr index e33b80408..bb980801b 100755 --- a/xCAT-client/bin/xcatclientnnr +++ b/xCAT-client/bin/xcatclientnnr @@ -51,6 +51,15 @@ foreach (keys %ENV) { } } +# Allow to print server information when -V/--verbose +foreach (reverse(@ARGV)) { + print $_; + if ($_ eq '-V' || $_ eq '--verbose') { + $ENV{'XCATSHOWSVR'} = 1; + last; + } +} + xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response); exit $xCAT::Client::EXITCODE; diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index 7934a2d9c..bd53594fd 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -4,7 +4,7 @@ B - set the boot state for a noderange =head1 B -B I [B | B | B | B | B[=I] | B | B] +B I [B | B | B | B | B[=I] | B | B] [B<-V>|B<--verbose>] B I B[=I] [B<--noupdateinitrd>] [B<--ignorekernelchk>] @@ -40,7 +40,7 @@ B only sets the next boot state, but does not reboot. B is called by B and B and is also called by the installation process remotely to set the boot state back to "boot". -In a hierarchical cluster which managed by service nodes, the boot stat of the nodes should be kept in consistence on the mn and on the service nodes. Then B command is required to be dispatched to the service nodes for handling the boot configuration files. There are multiple messages for one node from service nodes, it is hard to tell where is the problem from. To make the output more clear, user could run the command with "XCATSHOWSVR=1" environment variable, and then the output message will be appended with the server information. +In a hierarchical cluster managed by service nodes, B command is used to make sure compute node states are consistent on service and management nodes. When errors are reported, run the command with verbose mode. And the command will display additional service node information, which might be useful in identifying the problem. A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. @@ -92,6 +92,10 @@ The node will also be able to be sshed into and have utilities such as wget, tft To make the node to get into power off status. This status only can be used after B and B to power off the node after the performing of operations. +=item B<-V>|B<--verbose> + +Verbose mode. + =item B<-h>|B<--help> Print help. From 52b43e29f3222467e10adcbaae96111d7c57cd2d Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Tue, 1 Aug 2017 17:20:23 +0800 Subject: [PATCH 4/5] Remove the debug print --- xCAT-client/bin/rinstall | 1 - xCAT-client/bin/updatenode | 1 - xCAT-client/bin/xcatclient | 1 - xCAT-client/bin/xcatclientnnr | 1 - 4 files changed, 4 deletions(-) diff --git a/xCAT-client/bin/rinstall b/xCAT-client/bin/rinstall index 0a69b158f..8ca3357ec 100755 --- a/xCAT-client/bin/rinstall +++ b/xCAT-client/bin/rinstall @@ -69,7 +69,6 @@ my $noderange = $cmdref->{noderange}->[0]; # save the noderange # Allow to print server information when -V/--verbose foreach (reverse(@ARGV)) { - print $_; if ($_ eq '-V' || $_ eq '--verbose') { $ENV{'XCATSHOWSVR'} = 1; last; diff --git a/xCAT-client/bin/updatenode b/xCAT-client/bin/updatenode index bb7ddd80a..ebfe392e2 100755 --- a/xCAT-client/bin/updatenode +++ b/xCAT-client/bin/updatenode @@ -202,7 +202,6 @@ foreach (keys %ENV) { # Allow to print server information when -V/--verbose foreach (reverse(@ARGV)) { - print $_; if ($_ eq '-V' || $_ eq '--verbose') { $ENV{'XCATSHOWSVR'} = 1; last; diff --git a/xCAT-client/bin/xcatclient b/xCAT-client/bin/xcatclient index c59f59685..7f68579c9 100755 --- a/xCAT-client/bin/xcatclient +++ b/xCAT-client/bin/xcatclient @@ -104,7 +104,6 @@ foreach (keys %ENV) { # Allow to print server information when -V foreach (reverse(@ARGV)) { - print $_; if ($_ eq '-V') { $ENV{'XCATSHOWSVR'} = 1; last; diff --git a/xCAT-client/bin/xcatclientnnr b/xCAT-client/bin/xcatclientnnr index bb980801b..566dec3b2 100755 --- a/xCAT-client/bin/xcatclientnnr +++ b/xCAT-client/bin/xcatclientnnr @@ -53,7 +53,6 @@ foreach (keys %ENV) { # Allow to print server information when -V/--verbose foreach (reverse(@ARGV)) { - print $_; if ($_ eq '-V' || $_ eq '--verbose') { $ENV{'XCATSHOWSVR'} = 1; last; From 405ed14a20f15b670e143d904dd76f8f7d2fbed2 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Wed, 2 Aug 2017 15:33:42 +0800 Subject: [PATCH 5/5] Leverage syscall to resolve the hang in CI environment --- xCAT-server/sbin/xcatd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index e462ce99a..dd34ccbed 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -940,8 +940,8 @@ unless ($foreground) { daemonize; } -my @hostinfo = xCAT::NetworkUtils->determinehostname(); -my $XCATSERVER = $hostinfo[-1]; +# Cache the hostname, restart xcatd if hostname is changed after xcatd running +my $MYXCATSERVER = Sys::Hostname::hostname; $dbmaster = xCAT::Table::init_dbworker; if ($enable_perf) { @@ -2588,19 +2588,19 @@ sub send_response { if ($encode eq "xml") { my $xml; if ($response->{xcatresponse}) { # it's an aggregate, keeproot - if ($XCATSERVER) { + if ($MYXCATSERVER) { my $rsp = $response->{xcatresponse}; if ( (ref($rsp) eq 'ARRAY') && scalar(@$rsp) > 0 ) { foreach (@$rsp) { - $_->{xcatdsource}->[0] = $XCATSERVER unless ($_->{xcatdsource}); + $_->{xcatdsource}->[0] = $MYXCATSERVER unless ($_->{xcatdsource}); } } } $xml = XMLout($response, KeyAttr => [], NoAttr => 1, KeepRoot => 1); } else { - if ($XCATSERVER) { + if ($MYXCATSERVER) { unless (exists($response->{serverdone})) { - $response->{xcatdsource}->[0] = $XCATSERVER; + $response->{xcatdsource}->[0] = $MYXCATSERVER; } } $xml = XMLout($response, RootName => 'xcatresponse', NoAttr => 1);