File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
python/understack-workflows/understack_workflows Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ class PortConfiguration(BaseModel):
1212 node_uuid : str # using a str here due to ironicclient Port attribute
1313 name : str # port name
1414 pxe_enabled : bool
15+ local_link_connection : dict
Original file line number Diff line number Diff line change @@ -81,12 +81,22 @@ def port_configuration(
8181 name = f"{ interface .id } { interface .name } "
8282 pxe_enabled = interface .name == pxe_interface
8383
84+ if interface .neighbor_chassis_mac :
85+ local_link_connection = {
86+ "switch_id" : interface .neighbor_chassis_mac .lower (),
87+ "port_id" : interface .neighbor_interface_name ,
88+ "switch_info" : interface .neighbor_device_name ,
89+ }
90+ else :
91+ local_link_connection = {}
92+
8493 return PortConfiguration (
8594 node_uuid = device_id ,
8695 address = interface .mac_address .lower (),
8796 uuid = interface .id ,
8897 name = name ,
8998 pxe_enabled = pxe_enabled ,
99+ local_link_connection = local_link_connection ,
90100 )
91101
92102
You can’t perform that action at this time.
0 commit comments