# glance.async_.flows.api_image_import module

class glance.async_.flows.api_image_import.ImportActionWrapper(image_repo, image_id, task_id)

  Bases: `object`

  Wrapper for all the image metadata operations we do during an import.

  This is used to consolidate the changes we make to image metadata during an import operation, and can be used with an admin-capable repo to enable non-owner controlled modification of that data if desired.

  Use this as a context manager to make multiple changes followed by a save of the image in one operation. An _ImportActions object is yielded from the context manager, which defines the available operations.

  Parameters

    - image_repo – The ImageRepo we should use to fetch/save the image

    - image-id – The ID of the image we should be altering

  assert_task_lock()

    Assert that we own the task lock on the image.

    Raises

      TaskAbortedError if we do not

  drop_lock_for_task()

    Delete the import lock for our task.

    This is an atomic operation and thus does not require a context for the image save. Note that after calling this method, no further actions will be allowed on the image.

    Raises

      NotFound if the image was not locked by the expected task.

  property image_id

glance.async_.flows.api_image_import.assert_quota(context, task_repo, task_id, stores, action_wrapper, enforce_quota_fn, **enforce_kwargs)

glance.async_.flows.api_image_import.get_flow(**kwargs)

  Return task flow

  Parameters

    - task_id – Task ID

    - task_type – Type of the task

    - task_repo – Task repo

    - image_repo – Image repository used

    - image_id – ID of the Image to be processed

    - uri – uri for the image file

this page last updated: 2026-03-19 02:17:34

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug