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;