fix for bug 3239: do not use one socket connection to send two xcat commands to MN/SN, do not use gettab to get the site.tftpdir for performance consideration

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14640 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2012-12-13 07:21:39 +00:00
parent 9c09b4b077
commit 25171e52b8

View File

@ -539,40 +539,12 @@ sub getmypost {
}
}
}
#close $remote;
#$remote = IO::Socket::SSL->new(
# PeerAddr => $servnode,
# PeerPort => $port,
# Proto => 'tcp',
#);
if (! defined($TFTPDIR) ) {
print $remote "<xcatrequest>\n";
print $remote " <command>gettab</command>\n";
print $remote " <arg>key=tftpdir</arg>\n";
print $remote " <arg>site.value</arg>\n";
print $remote "</xcatrequest>\n";
while (<$remote>) {
$response .= $_;
if ($response =~ m/<\/xcatresponse>/) {
$rsp = eval { XMLin($response,SuppressEmpty=>undef,ForceArray=>1) };
print Dumper($rsp);
if ( ref($rsp) eq "HASH" && exists ( $rsp->{serverdone}) ) {
undef($response);
next;
#last;
}
$TFTPDIR=$rsp;
last;
}
}
}
close $remote;
# If the tftpdir is not /tftpboot,
# should use the -s flag to specify the tftpdir.
# using gettab to get the tftpdir from MN/SN is not efficient
# and has problem with sending multiple commands through one socket connection
if( !defined($TFTPDIR) ) {
$TFTPDIR="/tftpboot";
}