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

Interfaces API endpoint does not allow filtering by multiple device slugs #3724

Closed
lampwins opened this issue Dec 4, 2019 · 0 comments
Closed
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@lampwins
Copy link
Contributor

lampwins commented Dec 4, 2019

Environment

  • Python version: 2.6.8-dev
  • NetBox version: 3.7

Steps to Reproduce

  1. Create two devices named device-1 and device-2
  2. Create interfaces on each of those devices
  3. Attempt to filter the /api/dcim/interfaces/ endpoint by both the device names. i.e. /api/dcim/interfaces/?device=device-1&device=device-2

Expected Behavior

The result set to include all interfaces from both devices.

Observed Behavior

Only those interfaces belonging to device-2 are returned. This is because device-2 is listed last in the query param filter.

The root cause is the InterfaceFilter uses a method for the device field which does not accept multiple values.

https://github.com/netbox-community/netbox/blob/develop/netbox/dcim/filters.py#L750

@lampwins lampwins added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application labels Dec 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
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

No branches or pull requests

1 participant