@@ -174,8 +174,14 @@ def commit(self) -> None:
174
174
175
175
payload_model : list [PayloadVrfsAttachments ] = []
176
176
for vrf_attach_payload in diff_attach_list :
177
- new_lan_attach_list = self .update_lan_attach_list_model (vrf_attach_payload )
178
- vrf_attach_payload .lan_attach_list = new_lan_attach_list
177
+ lan_attach_list = self .update_lan_attach_list_model (vrf_attach_payload )
178
+ msg = f"ZZZ: lan_attach_list: { lan_attach_list } "
179
+ self .log .debug (msg )
180
+ # for item in lan_attach_list:
181
+ # if item.extension_values.VRF_LITE_CONN.VRF_LITE_CONN == [] and item.extension_values.MULTISITE_CONN.MULTISITE_CONN == []:
182
+ # item.extension_values = ""
183
+ vrf_attach_payload .lan_attach_list = lan_attach_list
184
+ # vrf_attach_payload.lan_attach_list = self.update_lan_attach_list_model(vrf_attach_payload)
179
185
payload_model .append (vrf_attach_payload )
180
186
181
187
msg = f"Setting payload_model: type(payload_model[0]): { type (payload_model [0 ])} length: { len (payload_model )} ."
@@ -184,6 +190,8 @@ def commit(self) -> None:
184
190
185
191
self ._payload_model = payload_model
186
192
self ._payload = json .dumps ([model .model_dump (exclude_unset = True , by_alias = True ) for model in payload_model ])
193
+ msg = f"Setting payload: { self ._payload } "
194
+ self .log .debug (msg )
187
195
188
196
def update_lan_attach_list_model (self , diff_attach : PayloadVrfsAttachments ) -> list [PayloadVrfsAttachmentsLanAttachListItem ]:
189
197
"""
@@ -351,19 +359,19 @@ def update_vrf_attach_vrf_lite_extensions(
351
359
352
360
## Description
353
361
354
- 1. Merge the values from the vrf_attach object into a matching
355
- vrf_lite extension object (if any) from the switch.
362
+ 1. Merge the values from the vrf_attach object into a matching vrf_lite extension object (if any) from the switch.
356
363
2. Update the vrf_attach object with the merged result.
357
364
3. Return the updated vrf_attach object.
358
365
359
- If no matching ControllerResponseVrfsSwitchesExtensionPrototypeValue model is found,
360
- return the unmodified vrf_attach object.
366
+ ## Raises
367
+
368
+ - ValueError if:
369
+ - No matching ControllerResponseVrfsSwitchesExtensionPrototypeValue model is found, return the unmodified vrf_attach object.
361
370
362
371
"matching" in this case means:
363
372
364
373
1. The extensionType of the switch's extension object is VRF_LITE
365
- 2. The IF_NAME in the extensionValues of the extension object
366
- matches the interface in vrf_attach.extension_values.
374
+ 2. The IF_NAME in the extensionValues of the extension object matches the interface in vrf_attach.extension_values.
367
375
"""
368
376
method_name = inspect .stack ()[0 ][3 ]
369
377
caller = inspect .stack ()[1 ][3 ]
0 commit comments