Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object update not working for custom fields #618

Open
haki99 opened this issue Jun 4, 2024 · 3 comments
Open

Object update not working for custom fields #618

haki99 opened this issue Jun 4, 2024 · 3 comments
Labels
pynetbox type: bug A confirmed report of unexpected behavior in the application

Comments

@haki99
Copy link

haki99 commented Jun 4, 2024

pynetbox version

v7.3.3

NetBox version

v4.0.3

Python version

3.11

Steps to Reproduce

Hi all!

I have trying to change an existing IP address's custom field (MAC address) and the code runs successfully but the change is not made to the IP address.

I have tried with these approaches:

With Endpoint update:

netbox.ipam.ip_addresses.update([{
       "id": netbox_ip.id,
       "custom_fields": {
              "Computer_MAC": "some new string mac"
       }
}])

With Respons - request update:

ip_address = netbox.ipam.ip_addresses.get(netbox_ip.id)
ip_address.update({
       "custom_fields": {
                 "Computer_MAC": "some new string mac"
       }
})

In previous Netbox versions this script runned successfully so I think something has changed in the API and Django structure.

Expected Behavior

The custom field of the IP address has changed.

Observed Behavior

The custom field of the IP address has not changed.

@haki99 haki99 added the type: bug A confirmed report of unexpected behavior in the application label Jun 4, 2024
@haki99
Copy link
Author

haki99 commented Jun 5, 2024

#598 maybe solve this issue if I am right, but not sure about it.

Also mentioned in this issue: #597

@jeremystretch jeremystretch added the pynetbox label Nov 1, 2024 — with Linear
@masikrus
Copy link

some one fix that?

@haki99
Copy link
Author

haki99 commented Jan 24, 2025

Hi @masikrus! Thank you for reviving this thread I totally forgot that I opened this. I found the solution a few months ago, but I moved on to use RestAPI instead so maybe I don't remember well. The solution was to use https connection with trusted cert (this one was what I missed).

Before that I was using a self-signed cert and just suspended the warning message with urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning) thinking that for testing purposes I dont need that. Turns out I do.

Can you please try it if it can solve it? If not I will check my archives next week at work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pynetbox type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants