Skip to content

Commit

Permalink
[FIX] KeyError: 'ipv4addrs' for IPv6 Host Record.
Browse files Browse the repository at this point in the history
  • Loading branch information
JkhatriInfobox committed Nov 14, 2024
1 parent a4dc4c7 commit 3d33996
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/module_utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def run(self, ib_obj_type, ib_spec):
# Handle use_for_ea_inheritance flag changes for IPv4addr in a host record
# Fetch the updated reference of host to avoid drift.
host_ref = self.connector.get_object(obj_type=str(res), return_fields=['ipv4addrs'])
if host_ref:
if host_ref and 'ipv4addrs' in host_ref:
# Create a dictionary for quick lookups
ref_dict = {obj['ipv4addr']: obj['_ref'] for obj in host_ref['ipv4addrs']}
sorted_ipv4addrs = sorted(proposed_object['ipv4addrs'], key=lambda x: x.get('use_for_ea_inheritance', False))
Expand Down

0 comments on commit 3d33996

Please sign in to comment.