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

multi_connect.py ValueError #64

Open
trondforgaard opened this issue May 13, 2022 · 3 comments
Open

multi_connect.py ValueError #64

trondforgaard opened this issue May 13, 2022 · 3 comments

Comments

@trondforgaard
Copy link

Throws this error when accessing the script.

<class 'ValueError'>

too many values to unpack (expected 2)

Python version: 3.8.10
NetBox version: 3.2.1
@yaiqsa
Copy link

yaiqsa commented May 31, 2022

The problem is that cable_status passes LinkStatusChoices.CHOICES as choices to the ChoiceVar contructor.

The VoiceVar constructor expects a list of two-tuples, while LinkStatusChoices.CHOICES is a three-tuple (The third item is the corresponding color).

I'm not sure if this should be fixed in

  • the extras.scripts module, by accepting three-tuples
  • the utilities.choices module, by providing a method or accessor that strips the 3rd element
  • the script itself, by stripping the third element itself ([(choice[0], choice[1]) for choice in choices])

@shatt79
Copy link
Contributor

shatt79 commented May 31, 2022

This is broken for me as well. Does not work on 3.2 or later. I would love it if someone knew how to fix it...

@shatt79
Copy link
Contributor

shatt79 commented Jun 8, 2022

I ended up just commenting out the "cable_status = ChoiceVar..." line and the "status=data["cable_status"]" line

The cable status field isn't that important. If I'm connecting cables, its obvious that they are "Connected", so letting the system use the default value is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants