diff --git a/plugins/convert_image/README.md b/plugins/convert_image/README.md deleted file mode 100644 index 97b4dbd..0000000 --- a/plugins/convert_image/README.md +++ /dev/null @@ -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" - } - - - diff --git a/plugins/convert_image/__init__.py b/plugins/convert_image/__init__.py deleted file mode 100644 index f37792b..0000000 --- a/plugins/convert_image/__init__.py +++ /dev/null @@ -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) diff --git a/plugins/convert_image/manifest-schema.json b/plugins/convert_image/manifest-schema.json deleted file mode 100644 index 6c7fd8d..0000000 --- a/plugins/convert_image/manifest-schema.json +++ /dev/null @@ -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"] -} diff --git a/plugins/convert_image/tasks.py b/plugins/convert_image/tasks.py deleted file mode 100644 index cd2d748..0000000 --- a/plugins/convert_image/tasks.py +++ /dev/null @@ -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)