Fixes #21845: Remove whitespace from connection values in interface CSV exports (#21850)

This commit is contained in:
Jeremy Stretch
2026-04-07 11:38:22 -04:00
committed by GitHub
parent d6a1cc5558
commit 1ebeb71ad8

View File

@@ -382,6 +382,17 @@ class PathEndpointTable(CableTerminationTable):
orderable=False
)
def value_connection(self, value):
if value:
connections = []
for termination in value:
if hasattr(termination, 'parent_object'):
connections.append(f'{termination.parent_object} > {termination}')
else:
connections.append(str(termination))
return ', '.join(connections)
return None
class ConsolePortTable(ModularDeviceComponentTable, PathEndpointTable):
device = tables.Column(
@@ -683,6 +694,15 @@ class InterfaceTable(BaseInterfaceTable, ModularDeviceComponentTable, PathEndpoi
orderable=False
)
def value_connection(self, record, value):
if record.is_virtual and hasattr(record, 'virtual_circuit_termination') and record.virtual_circuit_termination:
connections = [
f"{t.interface.parent_object} > {t.interface} via {t.parent_object}"
for t in record.connected_endpoints
]
return ', '.join(connections)
return super().value_connection(value)
class Meta(DeviceComponentTable.Meta):
model = models.Interface
fields = (