Fix qemu-img convert image incompatability in alpine linux
Alpine linux runs qemu-img version, where you cannot put parameter for convert "-f qcow2" in the end of the line, because it expects location. Parameter must be included before source and destination. Change-Id: I7f75eb62c19190c0d523b49dd371d603cafd753f Closes-Bug: 1634156
This commit is contained in:
parent
0132cc8c26
commit
ce25736643
|
@ -649,8 +649,8 @@ disk size: 4.4M
|
||||||
target = 't.qcow2'
|
target = 't.qcow2'
|
||||||
self.executes = []
|
self.executes = []
|
||||||
expected_commands = [('qemu-img', 'convert', '-O', 'raw',
|
expected_commands = [('qemu-img', 'convert', '-O', 'raw',
|
||||||
't.qcow2.part', 't.qcow2.converted',
|
'-f', 'qcow2',
|
||||||
'-f', 'qcow2'),
|
't.qcow2.part', 't.qcow2.converted'),
|
||||||
('rm', 't.qcow2.part'),
|
('rm', 't.qcow2.part'),
|
||||||
('mv', 't.qcow2.converted', 't.qcow2')]
|
('mv', 't.qcow2.converted', 't.qcow2')]
|
||||||
images.fetch_to_raw(context, image_id, target)
|
images.fetch_to_raw(context, image_id, target)
|
||||||
|
|
|
@ -96,9 +96,10 @@ def convert_image_unsafe(source, dest, out_format, run_as_root=False):
|
||||||
|
|
||||||
|
|
||||||
def _convert_image(source, dest, in_format, out_format, run_as_root):
|
def _convert_image(source, dest, in_format, out_format, run_as_root):
|
||||||
cmd = ('qemu-img', 'convert', '-O', out_format, source, dest)
|
cmd = ('qemu-img', 'convert', '-O', out_format)
|
||||||
if in_format is not None:
|
if in_format is not None:
|
||||||
cmd = cmd + ('-f', in_format)
|
cmd = cmd + ('-f', in_format)
|
||||||
|
cmd = cmd + (source, dest)
|
||||||
try:
|
try:
|
||||||
utils.execute(*cmd, run_as_root=run_as_root)
|
utils.execute(*cmd, run_as_root=run_as_root)
|
||||||
except processutils.ProcessExecutionError as exp:
|
except processutils.ProcessExecutionError as exp:
|
||||||
|
|
Loading…
Reference in New Issue