IP-addresses created via addition of FHRP group do not inherit default custom field values #7549

Closed
opened 2025-12-29 20:25:03 +01:00 by adam · 1 comment
Owner

Originally created by @olegbliaher on GitHub (Jan 23, 2023).

Originally assigned to: @kkthxbye-code on GitHub.

NetBox version

3.1.10

Python version

3.9

Steps to Reproduce

  1. Create a boolean custom field with a certain default value, for example False, and assign it the ipam | IP address-model.
  2. Add a new FHRP group (IPAM -> FHRP Groups) with a new, unused IP-address under Virtual IP Address.
  3. The new IP-address object attached to the VHRP-group does not have the custom field set, which generates an error when running reports.

Expected Behavior

I'd expect the new IP-address to have the default custom field value.

Observed Behavior

An exception occurred: KeyError: 'my_custom_field' Traceback (most recent call last): File "/usr/lib/netbox/app/extras/reports.py", line 234, in run test_method() File "/usr/local/lib/netbox/reports/my_report.py", line 11, in test_for_field if ip.custom_field_data["my_custom_field"]: 'my_custom_field'

Originally created by @olegbliaher on GitHub (Jan 23, 2023). Originally assigned to: @kkthxbye-code on GitHub. ### NetBox version 3.1.10 ### Python version 3.9 ### Steps to Reproduce 1. Create a boolean custom field with a certain default value, for example **False**, and assign it the `ipam | IP address`-model. 2. Add a new FHRP group (IPAM -> FHRP Groups) with a new, unused IP-address under **Virtual IP Address**. 3. The new IP-address object attached to the VHRP-group does not have the custom field set, which generates an error when running reports. ### Expected Behavior I'd expect the new IP-address to have the default custom field value. ### Observed Behavior An exception occurred: KeyError: 'my_custom_field' Traceback (most recent call last): File "/usr/lib/netbox/app/extras/reports.py", line 234, in run test_method() File "/usr/local/lib/netbox/reports/my_report.py", line 11, in test_for_field if ip.custom_field_data["my_custom_field"]: 'my_custom_field'
adam added the type: bugstatus: accepted labels 2025-12-29 20:25:03 +01:00
adam closed this issue 2025-12-29 20:25:04 +01:00
Author
Owner

@atownson commented on GitHub (Jan 25, 2023):

Related to #11040

@atownson commented on GitHub (Jan 25, 2023): Related to #11040
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7549