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

Webhook condition for having a primary IP doesn't appear to be working #11459

Closed
AesoSpadez opened this issue Jan 10, 2023 · 1 comment · Fixed by #11722
Closed

Webhook condition for having a primary IP doesn't appear to be working #11459

AesoSpadez opened this issue Jan 10, 2023 · 1 comment · Fixed by #11722
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@AesoSpadez
Copy link

NetBox version

v3.4.2

Python version

3.10

Steps to Reproduce

  1. Create a webhook, content type 'DCIM > Device', all events, with the condition:
    { "and": [ { "attr": "primary_ip", "value": "", "negate": true } ] }
  2. Create a site, all defaults.
  3. Create a device role, all defaults.
  4. Create a manufacturer, all defaults.
  5. Create a device type, all defaults.
  6. Create a device.
  7. Go to the admin panel, check the jobs in the default queue.

Expected Behavior

The webhook does not fire due to the condition of requiring a primary IP.

Observed Behavior

The webhook fires (despite the condition).

@AesoSpadez AesoSpadez added the type: bug A confirmed report of unexpected behavior in the application label Jan 10, 2023
@AesoSpadez
Copy link
Author

Seems to be similar/related to #10519 . We see this issue on our prod instance as well (v3.3.5, python 3.8).

@AesoSpadez AesoSpadez reopened this Jan 10, 2023
@kkthxbye-code kkthxbye-code self-assigned this Feb 10, 2023
@kkthxbye-code kkthxbye-code added the status: accepted This issue has been accepted for implementation label Feb 10, 2023
kkthxbye-code pushed a commit to kkthxbye-code/netbox that referenced this issue Feb 10, 2023
- Update docs to reflect this
- Change docs example from primary_ip to primary_ip4 as computed properties are not serialized when queuing webhooks
jeremystretch added a commit that referenced this issue Feb 13, 2023
* Fixes #11459 - Allow using null in conditions
- Update docs to reflect this
- Change docs example from primary_ip to primary_ip4 as computed properties are not serialized when queuing webhooks

* Update netbox/extras/conditions.py

---------

Co-authored-by: Simon Toft <[email protected]>
Co-authored-by: Jeremy Stretch <[email protected]>
jeremystretch added a commit that referenced this issue Feb 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants