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

Merge pull request #2575 from cxhong/matchedswitch

update switch definition only if -w or --setup option is specified for switchdiscover command
This commit is contained in:
yangsong 2017-03-06 14:26:49 +08:00 committed by GitHub
commit b687445478

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);
}