Skip to content

Commit c724f41

Browse files
Jason Yateslarsks
Jason Yates
authored andcommitted
A device that is part of a VC that has no name should display [virtual-chassis name]:[virtual-chassis position] as opposed to [device_type] in the rack rendering.
1 parent 05ebb5c commit c724f41

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

netbox/dcim/svg.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919

2020

2121
def get_device_name(device):
22-
return device.name or str(device.device_type)
22+
if device.virtual_chassis:
23+
return f'{device.virtual_chassis.name}:{device.vc_position}'
24+
elif device.name:
25+
return device.name
26+
else:
27+
return str(device.device_type)
2328

2429

2530
class RackElevationSVG:

0 commit comments

Comments
 (0)