Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/client/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def self.filter_data(data: nil,
end
return final
end
fail "No key \"#{filter}\" in #{data}" if data[filter].nil?
fail "No key \"#{filter}\" in #{data}" unless data.key?(filter)
data = data[filter]
end
end
Expand Down
5 changes: 4 additions & 1 deletion lib/cisco_node_utils/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ def drill_down_structured(value, ref)
value = value.is_a?(Hash) ? [value] : value
data = nil
value.each do |row|
data = row[data_key] if row[row_key].to_s[/#{row_index}/]
if row[row_key].to_s[/#{row_index}/]
data = row[data_key]
data = data.nil? ? '' : data
end
end
return value if data.nil?
if regexp_filter
Expand Down