ironic.common.image_publisher module

class ironic.common.image_publisher.AbstractPublisher[source]

Bases: object

Abstract base class for publishing images via HTTP.

abstract publish(source_path, file_name=None)[source]

Publish an image.

Parameters:
  • source_path – Path to the source file.

  • file_name – Destination file name. If None, the file component of source_path is used.

Returns:

The HTTP URL of the published image.

abstract unpublish(file_name)[source]

Unpublish the image.

Parameters:

file_name – File name to unpublish.

class ironic.common.image_publisher.LocalPublisher(image_subdir=None, file_permission=420, dir_permission=493, root_url=None)[source]

Bases: AbstractPublisher

Image publisher using a local web server.

publish(source_path, file_name=None)[source]

Publish an image.

Parameters:
  • source_path – Path to the source file.

  • file_name – Destination file name. If None, the file component of source_path is used.

Returns:

The HTTP URL of the published image.

unpublish(file_name)[source]

Unpublish the image.

Parameters:

file_name – File name to unpublish.

class ironic.common.image_publisher.SwiftPublisher(container, delete_after)[source]

Bases: AbstractPublisher

Image publisher using OpenStack Swift.

publish(source_path, file_name=None)[source]

Publish an image.

Parameters:
  • source_path – Path to the source file.

  • file_name – Destination file name. If None, the file component of source_path is used.

Returns:

The HTTP URL of the published image.

unpublish(file_name)[source]

Unpublish the image.

Parameters:

file_name – File name to unpublish.