libcsm.s3.images module

Module contents

Function to return rootfs, kernel, and the initrd image path given an image ID.

exception libcsm.s3.images.ImageFormatException(message)

Bases: Exception

An exception for problems getting “initrd”, “kernel”, “rootfs” image paths from an image in S3.

libcsm.s3.images.get_s3_image_info(bucket_name, image_id, endpoint_url)

Retrieve the initrd, rootfs, and kernel image for an S3 bucket and image ID.

This returns a dictionary

{
    "rootfs": "<rootfs_image_path>",
    "kernel": "<kernal_image_path>",
    "initrd": "<initrd_image_path>"
}
Parameters:
  • bucket_name – Name of bucket.

  • image_id – ID of image.

  • endpoint_url – S3 endpoint.

Raises:

ImageFormatException – When an image is not found.

Return type:

dict

Returns:

Dictionary of images.