2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 11:42:05 +00:00

update switch definition if -w or --setup option is specified

This commit is contained in:
Casandra Qiu 2017-03-01 16:45:30 -05:00
parent 83ebef0425
commit 39c4f68285

View File

@ -1423,7 +1423,10 @@ sub matchPredefineSwitch {
send_msg($request, 0, "Switch discovered and matched: $dswitch to $node" );
xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1);
# only write to xcatdb if -w or --setup option specified
if ( (exists($globalopt{w})) || (exists($globalopt{setup})) ) {
xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1);
}
push (@{$configswitch->{$stype}}, $node);
}