Skip to content

Commit

Permalink
fix: ipam interface should check on virtualmachine nil state
Browse files Browse the repository at this point in the history
  • Loading branch information
thde committed Oct 29, 2024
1 parent 89d6252 commit bf4a644
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/netbox_client_ruby/api/ipam/ip_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ def interface
interface_data = data['interface']

return nil unless interface_data

if interface_data.key?('virtual_machine')
Virtualization::Interface.new interface_data['id']
else
DCIM::Interface.new interface_data['id']
end
return Virtualization::Interface.new interface_data['id'] unless interface_data.dig('virtual_machine').nil?
return DCIM::Interface.new interface_data['id']
end
end
end
Expand Down

0 comments on commit bf4a644

Please sign in to comment.