remove die() calls

This commit is contained in:
Oliver Gorwits
2017-10-07 11:39:17 +01:00
parent b8108986fb
commit 08b34e083d
3 changed files with 5 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ sub gather_subnets {
my @subnets = (); my @subnets = ();
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device) my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or die "arpnip failed: could not SNMP connect to $device"; or return (); # already checked!
my $ip_netmask = $snmp->ip_netmask; my $ip_netmask = $snmp->ip_netmask;
foreach my $entry (keys %$ip_netmask) { foreach my $entry (keys %$ip_netmask) {

View File

@@ -86,7 +86,7 @@ sub store_neighbors {
my @to_discover = (); my @to_discover = ();
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device) my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or die "discover failed: could not SNMP connect to $device"; or return (); # already checked!
# first allow any manually configured topology to be set # first allow any manually configured topology to be set
set_manual_topology($device); set_manual_topology($device);
@@ -287,9 +287,7 @@ sub store_neighbors {
# in the devices table. only use root_ips and skip any bad topo entries. # in the devices table. only use root_ips and skip any bad topo entries.
sub set_manual_topology { sub set_manual_topology {
my $device = shift; my $device = shift;
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device) or return;
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or die "discover failed: could not SNMP connect to $device";
schema('netdisco')->txn_do(sub { schema('netdisco')->txn_do(sub {
# clear manual topology flags # clear manual topology flags

View File

@@ -152,7 +152,7 @@ sub get_vlan_list {
my $device = shift; my $device = shift;
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device) my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or die "macsuck failed: could not SNMP connect to $device"; or return (); # already checked!
return () unless $snmp->cisco_comm_indexing; return () unless $snmp->cisco_comm_indexing;
@@ -269,7 +269,7 @@ sub walk_fwtable {
my $cache = {}; my $cache = {};
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device) my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or die "macsuck failed: could not SNMP connect to $device"; or return $cache; # already checked!
my $fw_mac = $snmp->fw_mac; my $fw_mac = $snmp->fw_mac;
my $fw_port = $snmp->fw_port; my $fw_port = $snmp->fw_port;