class documentation
class Converter(object):
Known subclasses: ganeti.ovf.OVFExporter
, ganeti.ovf.OVFImporter
Converter class for OVF packages.
Converter is a class above both ImporterOVF and ExporterOVF. It's purpose is to provide a common interface for the two.
Method | __init__ |
Initialize the converter. |
Method |
|
Cleans the temporary directory, if one was created. |
Method |
|
Parses the data and creates a structure containing all required info. |
Method |
|
Saves the gathered configuration in an apropriate format. |
Instance Variable | options |
options parsed from the command line |
Instance Variable | output |
directory to which the results of conversion shall be written |
Instance Variable | temp |
temporary directory created then we deal with OVA |
Instance Variable | temp |
container for temporary files created during conversion |
Static Method | _ |
Figures out some information of the disk using qemu-img. |
Method | _ |
Performs (de)compression on the disk and returns the new path |
Method | _ |
Performes conversion to specified format. |
Method | _ |
Reads the data on which the conversion will take place. |
Initialize the converter.
Parameters | |
input | path to the Converter input file |
options:optparse.Values | command line options |
Raises | |
errors.OpPrereqError | if file does not exist |
overridden in
ganeti.ovf.OVFExporter
, ganeti.ovf.OVFImporter
Parses the data and creates a structure containing all required info.
overridden in
ganeti.ovf.OVFExporter
, ganeti.ovf.OVFImporter
Saves the gathered configuration in an apropriate format.
output_dir: string =
¶
overridden in
ganeti.ovf.OVFExporter
, ganeti.ovf.OVFImporter
directory to which the results of conversion shall be written
temp_dir: string =
¶
overridden in
ganeti.ovf.OVFExporter
, ganeti.ovf.OVFImporter
temporary directory created then we deal with OVA
Figures out some information of the disk using qemu-img.
Parameters | |
disk | path to the disk we want to know the format of |
regexp:string | string that has to be matched, it has to contain one group |
Returns | |
string | disk format |
Raises | |
errors.OpPrereqError | format information cannot be retrieved |
Performs (de)compression on the disk and returns the new path
Parameters | |
disk | path to the disk |
compression:string | compression type |
action:string | whether the action is compression or decompression |
Returns | |
string | new disk path after (de)compression |
Raises | |
errors.OpPrereqError | disk (de)compression failed or "compression" is not supported |
Performes conversion to specified format.
Parameters | |
disk | format to which the disk should be converted |
disk | path to the disk that should be converted |
Returns | |
string @return path to the output disk | Undocumented |
Raises | |
errors.OpPrereqError | convertion of the disk failed |
overridden in
ganeti.ovf.OVFExporter
, ganeti.ovf.OVFImporter
Reads the data on which the conversion will take place.
Parameters | |
input | absolute path to the Converter input file |