turn connect fail into defer
This commit is contained in:
@@ -23,7 +23,7 @@ sub _set_device_generic {
|
||||
|
||||
# snmp connect using rw community
|
||||
my $info = snmp_connect_rw($ip)
|
||||
or return job_error("Failed to connect to device [$ip] to update $slot");
|
||||
or return job_defer("Failed to connect to device [$ip] to update $slot");
|
||||
|
||||
my $method = 'set_'. $slot;
|
||||
my $rv = $info->$method($data);
|
||||
|
||||
@@ -75,7 +75,7 @@ sub _set_port_generic {
|
||||
if ($device->vendor ne 'netdisco') {
|
||||
# snmp connect using rw community
|
||||
my $info = snmp_connect_rw($ip)
|
||||
or return job_error("Failed to connect to device [$ip] to control port");
|
||||
or return job_defer("Failed to connect to device [$ip] to control port");
|
||||
|
||||
my $iid = get_iid($info, $port)
|
||||
or return job_error("Failed to get port ID for [$pn] from [$ip]");
|
||||
@@ -128,7 +128,7 @@ sub power {
|
||||
|
||||
# snmp connect using rw community
|
||||
my $info = snmp_connect_rw($ip)
|
||||
or return job_error("Failed to connect to device [$ip] to control port");
|
||||
or return job_defer("Failed to connect to device [$ip] to control power");
|
||||
|
||||
my $powerid = get_powerid($info, $port)
|
||||
or return job_error("Failed to get power ID for [$pn] from [$ip]");
|
||||
|
||||
@@ -64,7 +64,7 @@ sub _single_body {
|
||||
|
||||
my $snmp = snmp_connect($device);
|
||||
if (!defined $snmp) {
|
||||
return job_error("$job_type failed: could not SNMP connect to $host");
|
||||
return job_defer("$job_type failed: could not SNMP connect to $host");
|
||||
}
|
||||
|
||||
unless ($snmp->has_layer( $job_layer )) {
|
||||
|
||||
@@ -60,7 +60,7 @@ sub discover {
|
||||
|
||||
my $snmp = snmp_connect($device);
|
||||
if (!defined $snmp) {
|
||||
return job_error("discover failed: could not SNMP connect to $host");
|
||||
return job_defer("discover failed: could not SNMP connect to $host");
|
||||
}
|
||||
|
||||
store_device($device, $snmp);
|
||||
|
||||
Reference in New Issue
Block a user