2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 12:20:40 +00:00

set nodename as pdu or switch incase no name get by snmp or nmap

This commit is contained in:
ertaozh
2017-09-20 21:52:53 -04:00
parent 4410d4e282
commit b02df90e02

View File

@ -351,6 +351,9 @@ sub process_request {
#appending mac address to end of hostname
my $name = $result->{$_}->{name};
if (exists $username_hash{$name}) {
if ($name eq '') {
$name = "$device";
}
my $mac_str = lc($_);
$mac_str =~ s/\://g;
$result->{$_}->{name} = "$name-$mac_str";