Fix issues in naming and few other things

This commit is contained in:
ahmadbilalkhalid 2019-12-14 20:23:31 +05:00
commit 71279a968f
21 changed files with 274 additions and 281 deletions

View file

@ -20,9 +20,9 @@ def qemu_img_type(path):
def check():
""" check whether settings are sane, refuse to start if they aren't """
if config['etcd']['STORAGE_BACKEND'] == 'filesystem' and not isdir(config['etcd']['IMAGE_DIR']):
if config['storage']['backend'] == 'filesystem' and not isdir(config['storage']['image_dir']):
print("You have set STORAGE_BACKEND to filesystem, but "
"{} does not exist. Refusing to start".format(config['etcd']['IMAGE_DIR']))
"{} does not exist. Refusing to start".format(config['storage']['image_dir']))
sys.exit(1)
try:
@ -34,7 +34,7 @@ def check():
def main():
# We want to get images entries that requests images to be created
images = etcd_client.get_prefix(config['etcd']['IMAGE_PREFIX'], value_in_json=True)
images = etcd_client.get_prefix(config['etcd']['image_prefix'], value_in_json=True)
images_to_be_created = list(filter(lambda im: im.value['status'] == 'TO_BE_CREATED', images))
for image in images_to_be_created:
@ -43,9 +43,10 @@ def main():
image_owner = image.value['owner']
image_filename = image.value['filename']
image_store_name = image.value['store_name']
image_full_path = join_path(config['etcd']['BASE_DIR'], image_owner, image_filename)
image_full_path = join_path(config['storage']['file_dir'], image_owner, image_filename)
image_stores = etcd_client.get_prefix(config['etcd']['IMAGE_STORE_PREFIX'], value_in_json=True)
image_stores = etcd_client.get_prefix(config['etcd']['image_store_prefix'],
value_in_json=True)
user_image_store = next(filter(
lambda s, store_name=image_store_name: s.value["name"] == store_name,
image_stores