This fixes an error in case there are no disk names in the QA config
(which was the case till recently). Right now, QA tries to use 'None'
as disk name and that makes instance creation fail.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
for idx, disk in enumerate(qa_config.GetDiskOptions()):
size = disk.get("size")
name = disk.get("name")
- params.extend(["--disk", "%s:size=%s,name=%s" % (idx, size, name)])
+ diskparams = "%s:size=%s" % (idx, size)
+ if name:
+ diskparams += ",name=%s" % name
+ params.extend(["--disk", diskparams])
# Set static MAC address if configured
if force_mac: