get hostsname from hosts table

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5557 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2010-03-23 08:33:08 +00:00
parent e6c57804cc
commit b249bcca4d

View File

@ -1320,6 +1320,15 @@ sub getFactoryHostname
$host = $hname;
}
}
if ( !$host ) {
my $hoststab = xCAT::Table->new( 'hosts' );
my @entries = $hoststab->getAllNodeAttribs(['node','ip']);
foreach my $entry ( @entries ) {
if ( $entry->{ip} and $entry->{ip} eq $ip ) {
$host = $entry->{node};
}
}
}
return $host;
}