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

search for prefixes within a VRF does not work #3026

Closed
JuergenKammer opened this issue Mar 25, 2019 · 4 comments
Closed

search for prefixes within a VRF does not work #3026

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

Comments

@JuergenKammer
Copy link

Environment

  • Python version: 3.6.8
  • NetBox version: 2.5.8

Steps to Reproduce

  1. Create VRFs
  2. Create Prefixes in different VRFs
  3. Select "IPAM"->"Prefixes"
  4. Use the search area on the right side, select a VRF from which prefixes should be shown, and select "apply"

Expected Behavior

  1. Prefixes in only the selected VRF(s) are shown

Observed Behavior

  1. Prefixes from all VRFs are shown

REASON for the error:

  • the URL which is called when clicking on "apply" ends in something like:
    .../ipam/prefixes/?q=&within_include=&family=&mask_length=&vrf=8&is_pool=

SOLUTION:

it should be:
../ipam/prefixes/?q=&within_include=&family=&mask_length=&vrf_id=8&is_pool=

I.e. the selected vrf is mapped to its id, but the search looks for a vrf named such, not for the vrf_id with that number.

The URL with "vrf_id=..." results in the expected behavior.

@DanSheps
Copy link
Member

DanSheps commented Mar 25, 2019

I am unable to duplicate this on 2.5.8. Please provide a reproducible scenario on 2.5.8. Further, I checked the code and both the filter and form us "rd"

Data Load:

name, rd
VRF1, 1:1
VRF2, 2:2

prefix,vrf,status
192.168.1.0/24,1:1,Active
192.168.1.0/24,2:2,Active

Query:

IPAM->Prefixes
Filter for VRF1
"Apply"

Results:

192.168.1.0/24,1:1,Active

@DanSheps DanSheps added the status: revisions needed This issue requires additional information to be actionable label Mar 25, 2019
@JuergenKammer
Copy link
Author

Ah.
I have NOT defined any rd.
Thus, try again, and define your VRFs without an rd.

This also explains why it could creep in, because RDs have not been optional for along time...

@DanSheps
Copy link
Member

I see...

This is related to the way ModelMultipleChoiceFilter works, because when it comes up against an invalid value, it returns null to the filter (which filters on nothing so you get everything)

@DanSheps DanSheps added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation and removed status: revisions needed This issue requires additional information to be actionable labels Mar 25, 2019
@DanSheps
Copy link
Member

Any form using vrf rd will be affected.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 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

2 participants