lib/snmp/open.rb in snmp-open-0.1.5 vs lib/snmp/open.rb in snmp-open-0.2.0
- old
+ new
@@ -28,10 +28,10 @@
# Perform an SNMP get using the "snmpget" command and parse the output
def get(oids)
return enum_for(:get, oids) unless block_given?
texts = oids.map { |oid| reader.capture(:get, oid) }
- Parser.new(oids).parse(texts).first.each { |arg| yield(arg) }
+ Parser.new(oids).parse(texts).fetch(0, []).each { |arg| yield(arg) }
end
# Perform an SNMP walk using the "snmpwalk" or "snmpbulkwalk" commands and
# parse the output
def walk(oids, **kwargs)