Script ovfconverter
[hide private]
[frames] | no frames]

Script ovfconverter

Tool to translate between ovf and ganeti backup format.

Functions [hide private]
 
CheckOptions(parser, options_dict, required, forbidden, excluding, mode)
Performes check on the command line options.
tuple
ParseOptions()
Parses the command line options and arguments.
 
main()
Main routine.
Variables [hide private]
  IMPORT_MODE = "import"
  EXPORT_MODE = "export"

Imports: logging, optparse, os, cli, constants, errors, ovf, utils


Function Details [hide private]

CheckOptions(parser, options_dict, required, forbidden, excluding, mode)

 

Performes check on the command line options.

Checks whether the required arguments are present and if none of the arguments not supported for the current mode are given.

Parameters:
  • options_dict (list) - dictionary containing all the options from the command line
  • required (list) - list of pairs (option, argument) where 'option' is required in mode 'mode'
  • forbidden (list) - list of pairs (option, argument) which are not allowed in mode 'mode'
  • excluding (list) - list of pairs (argument1, argument2); each pair contains mutually exclusive arguments
  • mode (string) - current mode of the converter

ParseOptions()

 

Parses the command line options and arguments.

In case of mismatching parameters, it will show the correct usage and exit.

Returns: tuple
(mode, sourcefile to read from, additional options)