Skip to content

Commit

Permalink
fix: die with right reason when asked to parse an empty snmp walk
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Nov 21, 2023
1 parent c9160bc commit 599cf3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/GLPI/Agent/SNMP/Mock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ sub reset_original_context {
sub _setIndexedValues {
my ($self, $file) = @_;

my @lines = getAllLines(file => $file || $self->{_file});
my @lines = getAllLines(file => $file || $self->{_file})
or die "No content found in ".($file || $self->{_file})." file\n";

# check first line for safety
die "invalid file format\n" unless $lines[0] =~ /^(\S+) = .*/;
Expand Down

0 comments on commit 599cf3c

Please sign in to comment.