Skip to content

Commit 82ab99c

Browse files
Iustin-Mituangela-cncf
authored andcommitted
Pull request #30: fix remove items from update function
Merge in ISGAPPSEC/cyperf-api-wrapper from bug-fix-remove-one-item- to main Squashed commit of the following: commit 5eb3572c95353678a4bcaef6f1d709756b39e6ef Author: iustmitu <[email protected]> Date: Tue Jul 8 14:18:32 2025 +0300 fix len commit 6d0e53642df648b180a2d1bf4503906721d8f092 Author: iustmitu <[email protected]> Date: Tue Jul 8 12:57:14 2025 +0300 fix remove items from update function
1 parent 6adb76b commit 82ab99c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cyperf/dynamic_model_meta.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ def update(self):
139139
href_to_item = {}
140140
items_to_add = []
141141

142+
self_data_links = []
143+
for item in self.data:
144+
links = item.links
145+
if links != None:
146+
for link in links:
147+
self_data_links.append(link.href)
148+
142149
for item in self.dyn_data:
143150
link = item.get_self_link()
144151
if link is None or link.href is None:
@@ -153,7 +160,7 @@ def update(self):
153160
items_to_remove = [
154161
item for item in lst
155162
for link in getattr(item, "links", [])
156-
if getattr(link, "type", None) == "self" and link.href not in local_hrefs
163+
if getattr(link, "type", None) == "self" and link.href not in self_data_links
157164
]
158165

159166
if items_to_add:

0 commit comments

Comments
 (0)