mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
14 lines
504 B
Python
14 lines
504 B
Python
from base import Task
|
|
from common import phases
|
|
|
|
|
|
class ConvertImage(Task):
|
|
description = 'Converting raw image'
|
|
phase = phases.image_registration
|
|
|
|
def run(self, info):
|
|
from common.tools import log_check_call
|
|
converted_file = info.loopback_file.replace('img', info.manifest.plugins['convert_image']['format'])
|
|
log_check_call(['/usr/bin/qemu-img', 'convert', '-O', info.manifest.plugins['convert_image']['format'], info.loopback_file, converted_file])
|
|
import os
|
|
os.remove(info.loopback_file)
|