This commit is contained in:
ahmadbilalkhalid 2019-09-04 16:01:27 +05:00
parent 495fce8782
commit 4b95acc96c
1 changed files with 3 additions and 4 deletions

View File

@ -6,9 +6,9 @@ from config import logging, client, BASE_PATH, WITHOUT_CEPH
# If you are using WITHOUT_CEPH FLAG in .env
# then please make sure that /var/vm directory
# then please make sure that /var/image directory
# exists otherwise this script would fail
if WITHOUT_CEPH and not os.path.isdir("/var/vm"):
if WITHOUT_CEPH and not os.path.isdir("/var/image"):
exit(1)
@ -42,7 +42,7 @@ for image in images_to_be_created:
snapshot_protect_command = ["rbd", "snap", "protect", f"{image_store_pool}/{image_uuid}@protected"]
if WITHOUT_CEPH:
image_import_command = ["mv", "image.raw", os.path.join("/var/vm", image_uuid)]
image_import_command = ["mv", "image.raw", os.path.join("/var/image", image_uuid)]
snapshot_creation_command = ["true"]
snapshot_protect_command = ["true"]
@ -75,7 +75,6 @@ for image in images_to_be_created:
try:
# Convert .qcow2 to .raw
subprocess.check_output(qemu_img_convert_command)
print("converting")
except Exception as e:
logging.exception(e)
else: