Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions productmd/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
images.json files provide details about images included in composes.

Example::

import productmd.compose
compose = productmd.compose.Compose("/path/to/compose")

Expand All @@ -32,18 +33,15 @@

for variant in compose.images.images:
for arch in compose.images.images[variant]:
for images in compose.images.images[variant].values():
for image in compose.images.images[variant][arch]:
if image.type == 'qcow2':
qcow2s.add(image)

print(qcow2s)

print(qcow2s)

# ... prints the set of qcow2 images in all our variants:
# [<Image:Server-RT/x86_64/images/rhel-kvm-rt-image-7.6-220.x86_64.qcow2:qcow2:x86_64>,
# <Image:Server/x86_64/images/rhel-guest-image-7.6-210.x86_64.qcow2:qcow2:x86_64>,
# <Image:Server/ppc64le/images/rhel-guest-image-7.6-210.ppc64le.qcow2:qcow2:ppc64le>]
# ... prints the set of qcow2 images in all our variants:
# {<Image:Server-RT/x86_64/images/rhel-kvm-rt-image-7.6-220.x86_64.qcow2:qcow2:x86_64>,
# <Image:Server/x86_64/images/rhel-guest-image-7.6-210.x86_64.qcow2:qcow2:x86_64>,
# <Image:Server/ppc64le/images/rhel-guest-image-7.6-210.ppc64le.qcow2:qcow2:ppc64le>}

"""

Expand Down
Loading