Fix another UndefinedValueError: VM_DIR

decouple.UndefinedValueError: VM_DIR not found. Declare it as envvar or define a default value.
This commit is contained in:
Nico Schottelius 2019-12-07 14:10:16 +01:00
parent 9ae75f20e8
commit 2244b94fd8

View file

@ -33,8 +33,8 @@ running_vms = []
__storage_backend = env_vars.get("STORAGE_BACKEND", "filesystem")
if __storage_backend == "filesystem":
image_storage_handler = FileSystemBasedImageStorageHandler(vm_base=env_vars.get("VM_DIR"),
image_base=env_vars.get("IMAGE_DIR"))
image_storage_handler = FileSystemBasedImageStorageHandler(vm_base=env_vars.get("VM_DIR", "/tmp/ucloud-vms"),
image_base=env_vars.get("IMAGE_DIR", "/tmp/ucloud-images"))
elif __storage_backend == "ceph":
image_storage_handler = CEPHBasedImageStorageHandler(vm_base="ssd", image_base="ssd")
else: