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

Interface Role have extra entry 'r' #9267

Closed
Domoninic opened this issue Apr 30, 2022 · 2 comments · Fixed by #9275
Closed

Interface Role have extra entry 'r' #9267

Domoninic opened this issue Apr 30, 2022 · 2 comments · Fixed by #9275
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@Domoninic
Copy link

NetBox version

V3.2.2

Python version

3.8

Steps to Reproduce

1: Create / Edit IP address
2: Open Role Drop-down and scroll to bottom

Expected Behavior

Last entry is "CARP"

image

Observed Behavior

Last entry is "r"

image

This is observed in both local install and online Demo

@Domoninic Domoninic added the type: bug A confirmed report of unexpected behavior in the application label Apr 30, 2022
@steffenkremser
Copy link

steffenkremser commented May 2, 2022

Seems to be a typo in b3ea007

    CHOICES = (
        (ROLE_LOOPBACK, 'Loopback', 'gray'),
        (ROLE_SECONDARY, 'Secondary', 'blue'),
        (ROLE_ANYCAST, 'Anycast', 'yellow'),
        (ROLE_VIP, 'VIP', 'purple'),
        (ROLE_VRRP, 'VRRP', 'green'),
        (ROLE_HSRP, 'HSRP', 'green'),
        (ROLE_GLBP, 'GLBP', 'green'),
        (ROLE_CARP, 'CARP'), 'green',
    )

i.e. the ROLE_CARP tuple is closed prematurely (after just 2 elements)
.. the leftover literal 'green' is treated as a separate choice ['g','r','e',...]
.. and thus displayed as r (second element is display_value)

.. the obvious fix being

-        (ROLE_CARP, 'CARP'), 'green',
+        (ROLE_CARP, 'CARP', 'green'),

@kkthxbye-code kkthxbye-code self-assigned this May 2, 2022
@kkthxbye-code kkthxbye-code added the status: accepted This issue has been accepted for implementation label May 2, 2022
@kkthxbye-code
Copy link
Contributor

@steffenkremser - I submitted a PR. Thank you for doing the digging 👍

jeremystretch added a commit that referenced this issue May 2, 2022
Fixes #9267 - Fix early terminated tuple in IPAddressRoleChoices
jeremystretch added a commit that referenced this issue May 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2022
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.

3 participants