Fixed input value for xCAT UI. Allow code to handle different orders in /etc/hosts.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15142 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2013-02-11 22:49:44 +00:00
parent 05ade551f4
commit 184487e37e
3 changed files with 13 additions and 5 deletions

View File

@ -387,7 +387,7 @@ sub getIp {
# Get IP address
# You need the extra space in the pattern,
# else it will confuse gpok2 with gpok21
my $out = `cat /etc/hosts | grep "$node "`;
my $out = `cat /etc/hosts | egrep -i "$node | $node."`;
my @parms = split( ' ', $out );
return $parms[0];

View File

@ -2794,7 +2794,7 @@ function openAddVswitchVlanDialog(hcp) {
var hcp = $(this).find('select[name=hcp]').val();
var switchName = $(this).find('input[name=switchName]').val();
var deviceAddress = $(this).find('input[name=deviceAddress]').val();
var portName = $(this).find('input[name=switchName]').val();
var portName = $(this).find('input[name=portName]').val();
var controllerName = $(this).find('input[name=controllerName]').val();
var connection = $(this).find('select[name=connection]').val();
var queueMemoryLimit = $(this).find('input[name=queueMemoryLimit]').val();
@ -2829,7 +2829,7 @@ function openAddVswitchVlanDialog(hcp) {
if (updateSysConfig)
networkArgs += updateSysConfig + ";";
if (gvrp)
networkArgs += gvrpValue + ";";
networkArgs += gvrp + ";";
if (nativeVlanId)
networkArgs += nativeVlanId + ";";
networkArgs = networkArgs.substring(0, networkArgs.length - 1);

View File

@ -4479,10 +4479,14 @@ sub nodeSet {
}
# Get host IP and hostname from /etc/hosts
$out = `cat /etc/hosts | grep "$node "`;
$out = `cat /etc/hosts | egrep -i "$node |$node."`;
my @words = split( ' ', $out );
my $hostIP = $words[0];
my $hostname = $words[2];
if (!($hostname =~ m/./i)) {
$hostname = $words[1];
}
if ( !$hostIP || !$hostname ) {
xCAT::zvmUtils->printLn( $callback, "$node: (Error) Missing IP for $node in /etc/hosts" );
xCAT::zvmUtils->printLn( $callback, "$node: (Solution) Verify that the nodes IP address is specified in the hosts table and then run makehosts" );
@ -5603,10 +5607,14 @@ sub updateNode {
my $installDir = $entries[0];
# Get host IP and hostname from /etc/hosts
my $out = `cat /etc/hosts | grep $node`;
my $out = `cat /etc/hosts | egrep -i "$node |$node."`;
my @words = split( ' ', $out );
my $hostIP = $words[0];
my $hostname = $words[2];
if (!($hostname =~ m/./i)) {
$hostname = $words[1];
}
if ( !$hostIP || !$hostname ) {
xCAT::zvmUtils->printLn( $callback, "$node: (Error) Missing IP for $node in /etc/hosts" );
xCAT::zvmUtils->printLn( $callback, "$node: (Solution) Verify that the node's IP address is specified in the hosts table and then run makehosts" );