images – Image metadata

This module provides classes for manipulating images.json files. images.json files provide details about images included in composes.

productmd.images.SUPPORTED_IMAGE_TYPES = ['boot', 'cd', 'docker', 'dvd', 'ec2', 'kvm', 'live', 'netinst', 'p2v', 'qcow2', 'raw-xz', 'rescue', 'vagrant-libvirt', 'vagrant-virtualbox']

supported image types

productmd.images.SUPPORTED_IMAGE_FORMATS = ['iso', 'qcow', 'qcow2', 'raw', 'raw.xz', 'rhevm.ova', 'sda.raw', 'tar.gz', 'tar.xz', 'vagrant-libvirt.box', 'vagrant-virtualbox.box', 'vdi', 'vmdk', 'vmx', 'vsphere.ova']

supported image formats, they match with file suffix

Classes

class productmd.images.Images
add(variant, arch, image)

Assign an Image object to variant and arch.

Parameters:
  • variant (str) – compose variant UID
  • arch (str) – compose architecture
  • image (Image) – image
dump(f)

Dump data to a file.

Parameters:f (file or str) – file-like object or path to file
dumps()

Dump data to a string.

Return type:str
load(f)

Load data from a file.

Parameters:f (file or str) – file-like object or path to file
loads(s)

Load data from a string.

Parameters:s (str) – input data
validate()

Validate attributes by running all self._validate_*() methods.

Raises:
  • TypeError – if an attribute has invalid type
  • ValueError – if an attribute contains invalid value
class productmd.images.Image(parent)
path = None

(str) – relative path to an image, for example: “Server/x86_64/iso/boot.iso”

mtime = None

(int) – image mtime

size = None

(int) – image size

volume_id = None

(str) –

type = None

(str) –

format = None

(str) – Release name, for example: “Fedora”, “Red Hat Enterprise Linux”

arch = None

(str) – image architecture, for example: “x86_64”, “src”

disc_number = None

(int) – Release name, for example: “Fedora”, “Red Hat Enterprise Linux”

disc_count = None

(int) – Release name, for example: “Fedora”, “Red Hat Enterprise Linux”

checksums = None

(str) – Release name, for example: “Fedora”, “Red Hat Enterprise Linux”

implant_md5 = None

(str or None) – value of implanted md5

bootable = None

(bool=False) –

dump(f)

Dump data to a file.

Parameters:f (file or str) – file-like object or path to file
dumps()

Dump data to a string.

Return type:str
load(f)

Load data from a file.

Parameters:f (file or str) – file-like object or path to file
loads(s)

Load data from a string.

Parameters:s (str) – input data
validate()

Validate attributes by running all self._validate_*() methods.

Raises:
  • TypeError – if an attribute has invalid type
  • ValueError – if an attribute contains invalid value