image_build: fix subvariant handling

Dennis added a 'subvariant' property to the Docker image config,
but we weren't using it, we were just hard-coding the variant
as the subvariant...and doing it wrong, as well, using the
variant object rather than its uid property.

This fixes both problems: we'll now use the explicitly set
image config 'subvariant' property if there is one, otherwise
we use the variant.uid as the subvariant.

Note this is a high priority fix, as it broke F24 compose today.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2016-03-12 10:46:01 -08:00
parent be8605ac91
commit c321bca8ef
1 changed files with 3 additions and 4 deletions

View File

@ -229,9 +229,8 @@ class CreateImageBuildThread(WorkerThread):
img.disc_number = 1 # We don't expect multiple disks
img.disc_count = 1
img.bootable = False
img.subvariant = cmd["image_conf"]["image-build"]["variant"]
compose.im.add(variant=cmd["image_conf"]["image-build"]["variant"].uid,
arch=image_info['arch'],
image=img)
varname = cmd["image_conf"]["image-build"]["variant"].uid
img.subvariant = cmd["image_conf"]["image-build"].get("subvariant", varname)
compose.im.add(variant=varname, arch=image_info['arch'], image=img)
self.pool.log_info("[DONE ] %s" % msg)