From 4f6efee263f99cbae4f6d2cf82672cbd900c0655 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 1 Mar 2022 22:35:19 +0000 Subject: [PATCH] reverse test order to avoid undefined hash key error --- lib/App/Netdisco/Worker/Plugin/Discover/Entities.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/App/Netdisco/Worker/Plugin/Discover/Entities.pm b/lib/App/Netdisco/Worker/Plugin/Discover/Entities.pm index e49862c6..4f0032ad 100644 --- a/lib/App/Netdisco/Worker/Plugin/Discover/Entities.pm +++ b/lib/App/Netdisco/Worker/Plugin/Discover/Entities.pm @@ -100,7 +100,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub { } foreach my $m (@modules){ - unless ($seen_idx{$m->{parent}} || !$m->{parent}){ + unless (!$m->{parent} || $seen_idx{$m->{parent}}){ # Some combined devices like Nexus with FEX or ASR with Satellites can return invalid # EntityMIB trees. This workaround relocates entitites with invalid parents to the root # of the tree, so they are at least visible in the Modules tab (see #710)