virtual-chassis position zero #5527

Closed
opened 2025-12-29 19:29:01 +01:00 by adam · 5 comments
Owner

Originally created by @PieterL75 on GitHub (Oct 18, 2021).

Originally assigned to: @PieterL75 on GitHub.

NetBox version

v3.0.7

Python version

3.7

Steps to Reproduce

  1. Create 2 devices
  2. Create a new virtual chassis
  3. Set the Initial position to zero
  4. add the 2 devices
  5. Create the Virtual Chassis

Next one, also related

  1. Edit the virtual chassis
  2. Set the posistions to 0 an 1
  3. Save the VC
  4. check the overview of devices in the VC

Expected Behavior

A new VC is created with 2 members. with position 0 en 1.
The GUI shows the 0 and 1 position in a gray box

Observed Behavior

The members are created with position 1 and 2.
image

After correcting: The position 0 is not displayed
image

Originally created by @PieterL75 on GitHub (Oct 18, 2021). Originally assigned to: @PieterL75 on GitHub. ### NetBox version v3.0.7 ### Python version 3.7 ### Steps to Reproduce 1. Create 2 devices 2. Create a new virtual chassis 3. Set the Initial position to zero 4. add the 2 devices 5. Create the Virtual Chassis Next one, also related 1. Edit the virtual chassis 2. Set the posistions to 0 an 1 3. Save the VC 4. check the overview of devices in the VC ### Expected Behavior A new VC is created with 2 members. with position 0 en 1. The GUI shows the 0 and 1 position in a gray box ### Observed Behavior The members are created with position 1 and 2. ![image](https://user-images.githubusercontent.com/74899468/137729793-9af7e016-45e8-4665-84e4-7e34b9ef8d0d.png) After correcting: The position 0 is not displayed ![image](https://user-images.githubusercontent.com/74899468/137729634-9271bfcf-418a-4884-aeb6-cbfbc6bc712f.png)
adam added the type: bugstatus: accepted labels 2025-12-29 19:29:01 +01:00
adam closed this issue 2025-12-29 19:29:02 +01:00
Author
Owner

@PieterL75 commented on GitHub (Oct 18, 2021):

First issue seems to be related to this :
16f5e233d0/netbox/dcim/forms/object_create.py (L125)
This will cause 'initial_position' to become '1' if the get('initial_position') equals to {int}0
a=0
b=a or 1
b becomes 1
It can be fixed with
initial_position = self.cleaned_data.get('initial_position') if initial_position != None else 1

The second can be solved with this :
a1f271d7d9/netbox/utilities/templatetags/helpers.py (L378)
Change that to
'value': str(value),

@PieterL75 commented on GitHub (Oct 18, 2021): First issue seems to be related to this : https://github.com/netbox-community/netbox/blob/16f5e233d0d779a9bb65d32ee5f2f83a3467d5f3/netbox/dcim/forms/object_create.py#L125 This will cause 'initial_position' to become '1' if the get('initial_position') equals to {int}0 a=0 b=a or 1 b becomes 1 It can be fixed with ``` initial_position = self.cleaned_data.get('initial_position') if initial_position != None else 1``` The second can be solved with this : https://github.com/netbox-community/netbox/blob/a1f271d7d9cb1728a5f97379c3af10cae6f3b633/netbox/utilities/templatetags/helpers.py#L378 Change that to ``` 'value': str(value),```
Author
Owner

@DanSheps commented on GitHub (Oct 18, 2021):

What NOS allows a position of "0" for a virtual chassis?

@DanSheps commented on GitHub (Oct 18, 2021): What NOS allows a position of "0" for a virtual chassis?
Author
Owner

@PieterL75 commented on GitHub (Oct 18, 2021):

Junos has 0 for the first chassis id..

Ex
https://www.juniper.net/documentation/us/en/software/junos/virtual-chassis-mx/topics/ref/command/show-virtual-chassis-status-mx-series.html

Pieter

Op ma 18 okt. 2021 22:43 schreef Daniel Sheppard @.***>:

What NOS allows a position of "0" for a virtual chassis?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netbox-community/netbox/issues/7564#issuecomment-946149818,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AR3OADAIFQBHWIZ6BYYHPYLUHSBIPANCNFSM5GGQOYKA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

@PieterL75 commented on GitHub (Oct 18, 2021): Junos has 0 for the first chassis id.. Ex https://www.juniper.net/documentation/us/en/software/junos/virtual-chassis-mx/topics/ref/command/show-virtual-chassis-status-mx-series.html Pieter Op ma 18 okt. 2021 22:43 schreef Daniel Sheppard ***@***.***>: > What NOS allows a position of "0" for a virtual chassis? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netbox-community/netbox/issues/7564#issuecomment-946149818>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AR3OADAIFQBHWIZ6BYYHPYLUHSBIPANCNFSM5GGQOYKA> > . > Triage notifications on the go with GitHub Mobile for iOS > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> > or Android > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. > >
Author
Owner

@PieterL75 commented on GitHub (Oct 19, 2021):

You can assign it to me..

@PieterL75 commented on GitHub (Oct 19, 2021): You can assign it to me..
Author
Owner

@jeremystretch commented on GitHub (Nov 11, 2021):

Argh. Fixed in 3cb8c5db2 but I typoed the commit message.

@jeremystretch commented on GitHub (Nov 11, 2021): Argh. Fixed in 3cb8c5db2 but I typoed the commit message.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5527