mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Remove convert_image plugin
vdi is supported natively
This commit is contained in:
parent
2320b2cb74
commit
9628a5015b
4 changed files with 0 additions and 61 deletions
|
@ -1,11 +0,0 @@
|
||||||
this plugins helps to convert a raw image to an other format.
|
|
||||||
Supported formats are the one supported by qemu-img.
|
|
||||||
|
|
||||||
In the plugins section add:
|
|
||||||
|
|
||||||
"convert_image": {
|
|
||||||
"format": "vdi"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
def tasks(tasklist, manifest):
|
|
||||||
from tasks import ConvertImage
|
|
||||||
tasklist.add(ConvertImage)
|
|
||||||
|
|
||||||
|
|
||||||
def validate_manifest(data, schema_validate):
|
|
||||||
from os import path
|
|
||||||
schema_path = path.normpath(path.join(path.dirname(__file__), 'manifest-schema.json'))
|
|
||||||
schema_validate(data, schema_path)
|
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
||||||
"title": "Convert image",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"plugins": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"convert_image": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"format": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["format"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["convert_image"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["plugins"]
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
from base import Task
|
|
||||||
from common import phases
|
|
||||||
from common.tasks import loopback
|
|
||||||
|
|
||||||
|
|
||||||
class ConvertImage(Task):
|
|
||||||
description = 'Converting raw image'
|
|
||||||
phase = phases.image_registration
|
|
||||||
successors = [loopback.MoveImage]
|
|
||||||
|
|
||||||
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)
|
|
Loading…
Add table
Reference in a new issue