187
187
rtypes = [BOOT_RESOURCE_TYPE.UPLOADED]
188
188
name = image['release']
189
matching_resources = resources.filter(
189
resource = resources.filter(
190
190
rtype__in=rtypes, name=name,
191
architecture__startswith=image['architecture'])
192
for resource in matching_resources:
194
# This shouldn't happen at all, but just to be sure.
196
if not resource.supports_subarch(image['subarchitecture']):
197
# This matching resource doesn't support the images
198
# subarchitecture, so its not a matching resource.
200
resource_set = resource.get_latest_complete_set()
201
if resource_set is None:
202
# Possible that the import just started, and there is no
203
# set. Making it not a matching resource, as it cannot
204
# exist on the cluster unless it has a set.
206
if resource_set.label != image['label']:
207
# The label is different so the cluster has a different
208
# version of this set.
210
matched_resources.add(resource)
191
architecture__startswith=image['architecture']).first()
194
if not resource.supports_subarch(image['subarchitecture']):
196
resource_set = resource.get_latest_complete_set()
197
if resource_set is None:
199
if resource_set.label != image['label']:
201
matched_resources.add(resource)
211
202
return list(matched_resources)
213
204
def boot_images_are_in_sync(self, images):