Init macmap on demand. The handled_commands is no place for persistent initializations

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11669 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-02-23 13:45:45 +00:00
parent cf2bf477b8
commit 238baaf4f7

View File

@ -18,7 +18,6 @@ use xCAT::MellanoxIB;
my $macmap;
sub handled_commands {
$macmap = xCAT::MacMap->new();
return {
findme => 'switch',
findmac => 'switch',
@ -106,6 +105,9 @@ sub process_request {
my $req = shift;
my $cb = shift;
my $doreq = shift;
unless ($macmap) {
$macmap = xCAT::MacMap->new();
}
my $node;
my $mac = '';
if ($req->{command}->[0] eq 'findmac') {