mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
makebuildserver: make sure config is a dict
yaml.safe_load returns None for an empty file.
This commit is contained in:
parent
84dd97e007
commit
629b2650d0
1 changed files with 3 additions and 0 deletions
|
@ -84,6 +84,9 @@ if not os.path.exists(configfile):
|
||||||
shutil.copy('examples/Vagrantfile.yaml', configfile)
|
shutil.copy('examples/Vagrantfile.yaml', configfile)
|
||||||
with open(configfile) as fp:
|
with open(configfile) as fp:
|
||||||
config = yaml.safe_load(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:
|
with open('buildserver/Vagrantfile') as fp:
|
||||||
m = re.search(r"""\.vm\.box\s*=\s*["'](.*)["']""", fp.read())
|
m = re.search(r"""\.vm\.box\s*=\s*["'](.*)["']""", fp.read())
|
||||||
if not m:
|
if not m:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue