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:
		| @@ -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; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user