Commit 731fb5d5 by Máhonfai Bálint

Fix merge conflict

parent d9aafb6f
import json
import shutil
import os
import subprocess
import logging
......@@ -287,12 +289,18 @@ class Disk(object):
meta={'percent': percent}
)
cmdline = ['qemu-img',
'convert',
'-O', 'qcow2',
downloaded_file,
self.get_path()]
subprocess.check_output(cmdline)
with magic.Magic() as m:
ftype = m.id_filename(downloaded_file)
if 'qcow' in ftype.lower():
shutil.move(downloaded_file, self.get_path())
else:
cmdline = ['qemu-img',
'convert',
'-O', 'qcow2',
downloaded_file,
self.get_path()]
subprocess.check_output(cmdline)
except AbortException:
os.unlink(downloaded_file)
if os.path.exists(self.get_path()):
......
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