From b249bcca4d3979a5fd85b0e4716b88d07122223b Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 23 Mar 2010 08:33:08 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/lsslp.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index a53e290ad..20919012c 100644 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -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; }