@@ -68,11 +68,15 @@ class PciDeviceStats(object):
68
68
# the PCI alias, but they are matched by the placement
69
69
# allocation_candidates query, so we can ignore them during pool creation
70
70
# and during filtering here
71
- ignored_tags = ['resource_class' , 'traits' ]
72
- # these are metadata keys in the pool and in the request that are matched
71
+ ignored_spec_tags = ignored_pool_tags = ['resource_class' , 'traits' ]
72
+ # this is a metadata key in the spec that is matched
73
73
# specially in _filter_pools_based_on_placement_allocation. So we can
74
74
# ignore them in the general matching logic.
75
- ignored_tags += ['rp_uuid' , 'rp_uuids' ]
75
+ ignored_spec_tags += ['rp_uuids' ]
76
+ # this is a metadata key in the pool that is matched
77
+ # specially in _filter_pools_based_on_placement_allocation. So we can
78
+ # ignore them in the general matching logic.
79
+ ignored_pool_tags += ['rp_uuid' ]
76
80
77
81
def __init__ (
78
82
self ,
@@ -146,7 +150,11 @@ def _create_pool_keys_from_dev(
146
150
147
151
if tags :
148
152
pool .update (
149
- {k : v for k , v in tags .items () if k not in self .ignored_tags }
153
+ {
154
+ k : v
155
+ for k , v in tags .items ()
156
+ if k not in self .ignored_pool_tags
157
+ }
150
158
)
151
159
# NOTE(gibi): since PCI in placement maps a PCI dev or a PF to a
152
160
# single RP and the scheduler allocates from a specific RP we need
@@ -358,7 +366,9 @@ def _filter_pools_for_spec(
358
366
359
367
def ignore_keys (spec ):
360
368
return {
361
- k : v for k , v in spec .items () if k not in self .ignored_tags
369
+ k : v
370
+ for k , v in spec .items ()
371
+ if k not in self .ignored_spec_tags
362
372
}
363
373
364
374
request_specs = [ignore_keys (spec ) for spec in request .spec ]
0 commit comments