Skip to content

Commit

Permalink
Get a None rather than empty list when there are no ip addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Keay authored and cardoe committed Nov 13, 2024
1 parent a8f3252 commit ca4b15b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def parse_device(data: dict) -> NautobotDevice:

def parse_interface(data: dict) -> NautobotInterface:
connected = data["connected_interface"]
ip_address = data["ip_addresses"] and data["ip_addresses"][0]
ip_address = data["ip_addresses"][0] if data["ip_addresses"] else None
return NautobotInterface(
id=data["id"],
name=data["name"],
Expand Down

0 comments on commit ca4b15b

Please sign in to comment.