def migrate_images(ctx, flow, ids): for image in ctx.src_cloud.glance.images.list(): if image.id in ids: image_flow = image_tasks.migrate_image( ctx, image.id) flow.add(image_flow) return flow
def migrate_project_images(context, flow, tenant_id): images = context.src_cloud.glance.images.list( filters={"owner": tenant_id}) for image in list(images): image_binding = "image-{}".format(image.id) if image_binding not in context.store: image_flow = image_tasks.migrate_image(context, image.id) flow.add(image_flow)
def rebuild_by_image(context, server): image_id = server.image["id"] image_binding = "image-{}".format(image_id) image_ensure = "image-{}-ensure".format(image_id) pre_suspend = [] if image_binding not in context.store: image_flow = image_tasks.migrate_image(context, image_id) pre_suspend.append(image_flow) return pre_suspend, [image_ensure], [], image_ensure