Remove convert_image plugin

vdi is supported natively
This commit is contained in:
Anders Ingemann 2013-12-01 12:39:15 +01:00
parent 2320b2cb74
commit 9628a5015b
4 changed files with 0 additions and 61 deletions

View file

@ -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"
}

View file

@ -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)

View file

@ -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"]
}

View file

@ -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)