Commit 1bf2e9c2 by Guba Sándor

fixes

parent 0b339013
...@@ -90,15 +90,13 @@ class Disk(object): ...@@ -90,15 +90,13 @@ class Disk(object):
size = disk_info.get('virtual-size') size = disk_info.get('virtual-size')
actual_size = disk_info.get('actual-size') actual_size = disk_info.get('actual-size')
# Check if disk has base (backing-image) # Check if disk has base (backing-image)
# Based on backing image determine wether snapshot ot normal image
base_path = disk_info.get('backing-filename') base_path = disk_info.get('backing-filename')
if base_path: if base_path:
base_name = os.path.basename(base_path) base_name = os.path.basename(base_path)
else:
base_name = None
# Based on backing image determine weather snapshot ot normal image
if base_name:
type = 'snapshot' type = 'snapshot'
else: else:
base_name = None
type = 'normal' type = 'normal'
return Disk(dir, name, format, type, size, base_name, actual_size) return Disk(dir, name, format, type, size, base_name, actual_size)
...@@ -292,14 +290,14 @@ class Disk(object): ...@@ -292,14 +290,14 @@ class Disk(object):
sleep(1) sleep(1)
except AbortException: except AbortException:
proc.terminate() proc.terminate()
logger.warning("Aborted merge job removing %s", logger.warning("Aborted merge job, removing %s",
new_disk.get_path()) new_disk.get_path())
os.unlink(new_disk.get_path()) os.unlink(new_disk.get_path())
except: except:
if proc: if proc:
proc.terminate() proc.terminate()
logger.exception("Unknown error occured removing %s ", logger.exception("Unknown error occured, removing %s ",
new_disk.get_path()) new_disk.get_path())
os.unlink(new_disk.get_path()) os.unlink(new_disk.get_path())
raise raise
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment