Skip to content

Missing validation of Site consistency between Device, Rack, Rackgroup, and PowerPanel #5311

@candlerb

Description

@candlerb

(Extracted from #4971)

Environment

  • Python version: 3.6.9
  • NetBox version: 2.9.8

Summary: missing validation of the consistency of links from Device, Rack and Rackgroup tree to Site.

Steps to Reproduce

Case 1: Device-Site not matching Rack-Site

1. Create sites A and B
2. Create rack R in site A
3. Create device D in site A and rack R
4. Change rack R to site B

Case 2: Rack-Site not matching Rackgroup-Site

  1. Create sites A and B
  2. Create rackgroup G in site A
  3. Create rack R in site A and rackgroup G
  4. Change rackgroup G to site B

Case 3: Rackgroup-Site not matching parent Rackgroup-Site

  1. Create sites A and B
  2. Create rackgroup G1 in site A
  3. Create rackgroup G2 in site A with parent rackgroup G1
  4. Change rackgroup G1 to site B

Case 4: These relationships also apply transitively: parent rackgroup -> child rackgroup -> rack -> device

  1. Create sites A and B
  2. Create rackgroup G1 in site A
  3. Create rackgroup G2 in site A with parent rackgroup G1
  4. Create rack R in site A and rackgroup G2
  5. Create device D in site A and rack R
  6. Change rackgroup G1 to site B

Expected Behavior

In case 1: either change to be rejected, or rack R's new site to be propagated to all Devices underneath it
In case 2: either change to be rejected, or rack group G's new site to be propagated to all Racks underneath it
In case 3: either change to be rejected, or rack group G1's new site to be propagated to all child and descendant rackgroups
In case 4: either change to be rejected, or rack group G1's new site to be propagated recursively to all child and descendant rackgroups, racks and devices

Observed Behavior

In case 1: device D is in site A but its rack is in site B
In case 2: rack R is in site A but its rackgroup is in site B
In case 3: rackgroup G2 is in site A but its parent rackgroup G1 is in site B
In case 4: device D, rack R, rackgroup G2 are all in site A but the ancestor rackgroup G1 is in site B

Additional Note

PowerPanel also has a link to Site and RackGroup, so a similar issue applies there too.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions