Adding host devices to a cluster should exclude devices already assigned #1294

Closed
opened 2025-12-29 16:31:09 +01:00 by adam · 7 comments
Owner

Originally created by @Gelob on GitHub (Oct 12, 2017).

Issue type

[ ] Feature request
[ X ] Bug report
[ ] Documentation

Environment

  • Python version: 2.7.5
  • NetBox version: 2.2.1

Description

When searching for devices to add to a virtualization cluster (virtualization/clusters/1/devices/add/), devices that are already part of a cluster show up. If you attempt to add a device that is already part of an existing cluster you will get a Server Error `<type 'exceptions.TypeError'>

'NoneType' object is not iterable`

This would also help in finding devices quicker because the search only returns a limited number of results.

Originally created by @Gelob on GitHub (Oct 12, 2017). ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [ X ] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) --> ### Environment * Python version: 2.7.5 * NetBox version: 2.2.1 ### Description When searching for devices to add to a virtualization cluster (virtualization/clusters/1/devices/add/), devices that are already part of a cluster show up. If you attempt to add a device that is already part of an existing cluster you will get a Server Error `<type 'exceptions.TypeError'> 'NoneType' object is not iterable` This would also help in finding devices quicker because the search only returns a limited number of results.
adam added the type: bug label 2025-12-29 16:31:09 +01:00
adam closed this issue 2025-12-29 16:31:09 +01:00
Author
Owner

@RyanBreaker commented on GitHub (Oct 12, 2017):

I'll take a stab at this, hold my beer.

This should also probably be a bug report instead of feature request, especially since it does return an error.

@RyanBreaker commented on GitHub (Oct 12, 2017): I'll take a stab at this, hold my beer. This should also probably be a bug report instead of feature request, especially since it does return an error.
Author
Owner

@Gelob commented on GitHub (Oct 12, 2017):

@RyanBreaker consider your beer held. I've updated it to a bug report. I couldn't decide and figured feature.

@Gelob commented on GitHub (Oct 12, 2017): @RyanBreaker consider your beer held. I've updated it to a bug report. I couldn't decide and figured feature.
Author
Owner

@jeremystretch commented on GitHub (Oct 13, 2017):

@Gelob I'm not able to reproduce this. Could you please update your report with the steps needed to reproduce the error?

@jeremystretch commented on GitHub (Oct 13, 2017): @Gelob I'm not able to reproduce this. Could you please update your report with the steps needed to reproduce the error?
Author
Owner

@RyanBreaker commented on GitHub (Oct 13, 2017):

I was actually about to say, I don't get any Python errors but instead just a more generic message saying it cannot be added.

@RyanBreaker commented on GitHub (Oct 13, 2017): I was actually about to say, I don't get any Python errors but instead just a more generic message saying it cannot be added.
Author
Owner

@RyanBreaker commented on GitHub (Oct 14, 2017):

@jeremystretch I guess it comes down to how we want it to behave then, if we want to just make devices already in a cluster even show up or just disable them from being selectable.

@RyanBreaker commented on GitHub (Oct 14, 2017): @jeremystretch I guess it comes down to how we want it to behave then, if we want to just make devices already in a cluster even show up or just disable them from being selectable.
Author
Owner

@Gelob commented on GitHub (Oct 16, 2017):

I think it has to do with when the cluster is assigned to a site, if its not assigned to a site I just get "Select a valid choice. 1812 is not one of the available choices."

If I assign the cluster to a site I do get the attached error
screen shot 2017-10-16 at 4 29 04 pm

  1. Create a new cluster, and assign it to a site.
  2. Create a new device in that same site
  3. Assign that device to the new cluster you created
  4. Try to assign that same device to that cluster (or another cluster that has a site assignment)
@Gelob commented on GitHub (Oct 16, 2017): I think it has to do with when the cluster is assigned to a site, if its not assigned to a site I just get "Select a valid choice. 1812 is not one of the available choices." If I assign the cluster to a site I do get the attached error ![screen shot 2017-10-16 at 4 29 04 pm](https://user-images.githubusercontent.com/422752/31636291-6c9536e2-b28f-11e7-9f5e-76f4f1356574.png) 1. Create a new cluster, and assign it to a site. 2. Create a new device in that same site 3. Assign that device to the new cluster you created 4. Try to assign that same device to that cluster (or another cluster that has a site assignment)
Author
Owner

@jeremystretch commented on GitHub (Oct 17, 2017):

Fixed in 34f1a9ebfb

@jeremystretch commented on GitHub (Oct 17, 2017): Fixed in 34f1a9ebfb6faa4c98fb6792fb3994a18f860990
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1294