2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

fix issue switchtype didn't set for cumulus switch after discover #3976

This commit is contained in:
immarvin 2017-09-21 04:30:15 -04:00
parent 72e5e44975
commit e0ec727564

View File

@ -248,8 +248,16 @@ sub process_request {
#for onie switch, lookup and set the switchtype via mac of mgt interface
my $switchestab = xCAT::Table->new('switches');
if ($switchestab) {
my $switchtype=$xCAT::data::switchinfo::global_mac_identity{substr(lc($request->{_xcat_clientmac}->[0]),0,8)};
if(defined $switchtype){
my $switchtype;
my $switchvendor=$xCAT::data::switchinfo::global_mac_identity{substr(lc($request->{_xcat_clientmac}->[0]),0,8)};
if(defined $switchvendor){
my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type);
if ($switchvendor =~ /($search_string)/) {
$switchtype=$xCAT::data::switchinfo::global_switch_type{$1};
}
}
if($switchtype){
$switchestab->setNodeAttribs($node,{ switchtype => $switchtype });
}
$switchestab->close();