From 3f9a2d5bae63533881f3c07db2d1a7c6019d0130 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 28 Feb 2019 10:48:20 +0100 Subject: [PATCH] fix printer errror status --- snmp_standard/mode/printererror.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snmp_standard/mode/printererror.pm b/snmp_standard/mode/printererror.pm index cb1717cf1..10f060be4 100644 --- a/snmp_standard/mode/printererror.pm +++ b/snmp_standard/mode/printererror.pm @@ -124,11 +124,6 @@ sub manage_selection { my $value = unpack('S', $result->{$_}); $self->{printer}->{$instance} = { display => $instance, errors => {} }; - if ($result->{$_} == 0) { - $self->{printer}->{$instance}->{errors}->{0} = { status => 'ok' }; - next; - } - my $i = 0; foreach my $key (keys %errors_printer) { if (($value & (1 << $key))) { @@ -136,6 +131,11 @@ sub manage_selection { $i++; } } + + if ($i == 0) { + $self->{printer}->{$instance}->{errors}->{0} = { status => 'ok' }; + next; + } } }