From 01fa8a148c36cada4ff86405e753e1e4b394c68b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 14 Mar 2009 15:47:48 +0000 Subject: [PATCH] -Eliminate 'use SNMP' from places to get memory consumption down git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2899 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/MacMap.pm | 7 ++++++- xCAT-server/lib/xcat/plugins/nodediscover.pm | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index d3fd9ddb4..3756429db 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -8,7 +8,6 @@ use IO::Select; use IO::Handle; use Sys::Syslog; use Data::Dumper; -use SNMP; my %cisco_vlans; #Special hash structure to reflect discovered VLANS on Cisco equip #use IF-MIB (1.3.6.1.2.1.2) for all switches # 1.3.6.1.2.1.31.1.1 - ifXtable @@ -78,6 +77,12 @@ OID, and have the switch table port value match exactly the format suggested by sub new { my $self = {}; + eval { + require SNMP; + }; + if ($@) { + die "SNMP support required to use MacMAP"; + } my $proto = shift; my $class = ref($proto) || $proto; diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index 4687456d3..0aefd78e4 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -1,10 +1,8 @@ #!/usr/bin/env perl # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html package xCAT_plugin::nodediscover; -#use Net::SNMP qw(:snmp INTEGER); use xCAT::Table; use IO::Socket; -use SNMP; use strict; use XML::Simple;