diff --git a/perl-xCAT/xCAT/zvmUtils.pm b/perl-xCAT/xCAT/zvmUtils.pm index 012920688..de8e528fa 100644 --- a/perl-xCAT/xCAT/zvmUtils.pm +++ b/perl-xCAT/xCAT/zvmUtils.pm @@ -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]; diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js index f91916fd9..013f654b5 100644 --- a/xCAT-UI/js/custom/zvmUtils.js +++ b/xCAT-UI/js/custom/zvmUtils.js @@ -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); diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index f7b888c9b..1b922a7ff 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -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" );