From 6266c3302795b76e3f09d6b796a40c698bbaf8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Tue, 5 Jun 2018 00:03:17 +0200 Subject: [PATCH] makebuildserver: fix lookup logic for needs_mutate --- makebuildserver | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/makebuildserver b/makebuildserver index 494fc9c8..a5dab7f8 100755 --- a/makebuildserver +++ b/makebuildserver @@ -520,14 +520,9 @@ def main(): yaml.dump(config, f) if config['vm_provider'] == 'libvirt': - found_basebox = False - needs_mutate = False - for box in v.box_list(): - if box.name == config['basebox']: - found_basebox = True - if box.provider != 'libvirt': - needs_mutate = True - continue + available_providers = [x.provider for x in v.box_list() if x.name == config['basebox']] + found_basebox = len(available_providers) > 0 + needs_mutate = 'libvirt' not in available_providers if not found_basebox: if isinstance(config['baseboxurl'], str): baseboxurl = config['baseboxurl']