From 483e51ed829768c1fcbdfdbbe7c08b165956d9d4 Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Sat, 5 May 2018 16:24:36 +0200 Subject: [PATCH] Default image creation to qcow2 type It is described in the docs, that nodepool will build image only if it is referred in one of the clouds, but it is possible to force that creation: `nodepool image-build fedora-28`. This leads to inability to define image types and an empty "-t" argument to DIB; which causes the command invocation to fail. Default the type value to qcow2. This matches the default type that dib will create and keeps with the general principle of nodepool figuring out what type of image to make for you. Change-Id: I27f8f45ba62e5ee0cca0ea7cd27893092b726ebd Story: 2001963 --- nodepool/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nodepool/config.py b/nodepool/config.py index 5fbaa9ba4..733ed3a64 100755 --- a/nodepool/config.py +++ b/nodepool/config.py @@ -95,6 +95,9 @@ class Config(ConfigValue): if not isinstance(d.env_vars, dict): d.env_vars = {} d.image_types = set(diskimage.get('formats', [])) + # Ensure at least qcow2 is set to be passed to qemu-img + if not d.image_types: + d.image_types.add('qcow2') d.pause = bool(diskimage.get('pause', False)) d.username = diskimage.get('username', 'zuul') self.diskimages[d.name] = d