2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Leverage syscall to resolve the hang in CI environment

This commit is contained in:
Bin Xu 2017-08-02 15:33:42 +08:00
parent 52b43e29f3
commit 405ed14a20

View File

@ -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);