# HG changeset patch # User Mahlon E. Smith # Date 1473184658 25200 # Node ID d46ca2b52efe7fac5d2090eebb6190a6f2562c24 # Parent 3d395894a3cfc314f156d45e626afacda97241b5 Put the nil check back when building the results hash. diff -r 3d395894a3cf -r d46ca2b52efe lib/arborist/monitor/snmp.rb --- a/lib/arborist/monitor/snmp.rb Mon Sep 05 20:59:01 2016 -0700 +++ b/lib/arborist/monitor/snmp.rb Tue Sep 06 10:57:38 2016 -0700 @@ -23,7 +23,7 @@ log_to :arborist # The version of this library. - VERSION = '0.2.0' + VERSION = '0.2.1' # "Modes" that this monitor understands. VALID_MODES = %i[ disk load memory swap process ] @@ -248,8 +248,8 @@ # Map everything back to identifier -> attribute(s), and send to the manager. # reply = self.results.each_with_object({}) do |(address, results), hash| - identifier = self.identifiers[ address ].first - hash[ identifier ] = results + identifier = self.identifiers[ address ] or next + hash[ identifier.first ] = results end self.log.debug "Sending to manager: %p" % [ reply ] return reply