From 7db2962e5bb3f0b7b5a87775800a9aa04d094964 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 3 Aug 2010 19:15:43 +0000 Subject: [PATCH] Fix a bug where the node found in /etc/hosts could contain the same pattern and give the incorrect return. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6964 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 56b357753..a657a7c18 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -2843,7 +2843,7 @@ sub nodeSet { my $tmpl = "$profile.$osBase.$arch.tmpl"; # Get host IP and hostname from /etc/hosts - $out = `cat /etc/hosts | grep $node`; + $out = `cat /etc/hosts | grep "$node "`; my @words = split( ' ', $out ); my $hostIP = $words[0]; my $hostname = $words[2]; @@ -2975,7 +2975,7 @@ sub nodeSet { xCAT::zvmUtils->printLn( $callback, "$node: (Error) Node does not belong to any network in the networks table" ); return; } - + @propNames = ( 'mask', 'gateway', 'tftpserver', 'nameservers' ); $propVals = xCAT::zvmUtils->getTabPropsByKey( 'networks', 'net', $network, @propNames ); my $mask = $propVals->{'mask'}; @@ -2988,7 +2988,7 @@ sub nodeSet { xCAT::zvmUtils->printLn( $callback, "$node: (Error) Missing network information" ); return; } - + # Get broadcast address of NIC my $ifcfg = xCAT::zvmUtils->getIfcfgByNic( $hcp, $readChannel ); $out = `ssh $hcp "cat $ifcfg" | grep "BROADCAST"`;