From 629b2650d0b1abfe7a95843a963da27c53822079 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Mon, 6 Feb 2023 16:30:15 +0100 Subject: [PATCH] makebuildserver: make sure config is a dict yaml.safe_load returns None for an empty file. --- makebuildserver | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makebuildserver b/makebuildserver index e7c006f1..5d181b53 100755 --- a/makebuildserver +++ b/makebuildserver @@ -84,6 +84,9 @@ if not os.path.exists(configfile): shutil.copy('examples/Vagrantfile.yaml', configfile) with open(configfile) as fp: config = yaml.safe_load(fp) + if not isinstance(config, dict): + logging.info("config is empty or not a dict, using default.") + config = {} with open('buildserver/Vagrantfile') as fp: m = re.search(r"""\.vm\.box\s*=\s*["'](.*)["']""", fp.read()) if not m: