Handle case where site domain is not set
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3242 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
4084303555
commit
ccf5e0cb2b
@ -595,7 +595,15 @@ if ($inet6support) {
|
||||
|
||||
unless ($peerhost) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); }
|
||||
$peerfqdn=$peerhost;
|
||||
$peerhost =~ s/\.$domain\.*$//;
|
||||
|
||||
if ($domain) {
|
||||
# strip off domain if set
|
||||
$peerhost =~ s/\.$domain\.*$//;
|
||||
} else {
|
||||
# otherwise just strip off whatever comes after the first dot
|
||||
$peerhost =~ s/^.*?\.//;
|
||||
}
|
||||
|
||||
$peerhost =~ s/-eth\d*$//;
|
||||
$peerhost =~ s/-myri\d*$//;
|
||||
$peerhost =~ s/-ib\d*$//;
|
||||
|
Loading…
Reference in New Issue
Block a user