COT.submodule module¶
Parent classes for implementing COT subcommands.
Classes
COTGenericSubmodule |
Abstract interface for COT command submodules. |
COTReadOnlySubmodule |
Class for submodules that do not modify the OVF, such as ‘deploy’. |
COTSubmodule |
Class for submodules that read and write the OVF. |
-
class
COTGenericSubmodule(ui)[source]¶ Bases:
objectAbstract interface for COT command submodules.
Note
Generally a command should not inherit directly from this class, but should instead subclass
COTReadOnlySubmoduleorCOTSubmoduleas appropriate.-
__init__(ui)[source]¶ Instantiate this submodule with the given UI.
Parameters: ui (UI) – User interface instance.
-
finished()[source]¶ Do any final actions before being destroyed.
This class does nothing; subclasses may choose to do things like write their VM state out to a file.
-
ready_to_run()[source]¶ Check whether the module is ready to
run().Returns: tuple – (True, ready_message)or(False, reason_why_not)
-
run()[source]¶ Do the actual work of this submodule.
Raises: InvalidInputError– ifready_to_run()reportsFalse
-
ui= None¶ User interface instance (
UIor subclass).
-
vm= None¶ Virtual machine description (
VMDescription).
-
-
class
COTReadOnlySubmodule(ui)[source]¶ Bases:
COT.submodule.COTGenericSubmoduleClass for submodules that do not modify the OVF, such as ‘deploy’.
Inherited attributes:
vm,uiAttributes:
package-
__init__(ui)[source]¶ Instantiate this submodule with the given UI.
Parameters: ui (UI) – User interface instance.
-
ready_to_run()[source]¶ Check whether the module is ready to
run().Returns: tuple – (True, ready_message)or(False, reason_why_not)
-
package¶ VM description file to read from.
Calls
COT.vm_factory.VMFactory.create()to instantiateself.vmfrom the provided file.Raises: InvalidInputError– if the file does not exist.
-
-
class
COTSubmodule(ui)[source]¶ Bases:
COT.submodule.COTGenericSubmoduleClass for submodules that read and write the OVF.
Inherited attributes:
vm,ui-
__init__(ui)[source]¶ Instantiate this submodule with the given UI.
Parameters: ui (UI) – User interface instance.
-
ready_to_run()[source]¶ Check whether the module is ready to
run().Returns: tuple – (True, ready_message)or(False, reason_why_not)
-
run()[source]¶ Do the actual work of this submodule.
If
outputwas not previously set, automatically sets it to the value ofPACKAGE.Raises: InvalidInputError– ifready_to_run()reportsFalse
-
output¶ Output file for this submodule.
If the specified file already exists, will prompt the user (
confirm_or_die()) to confirm overwriting the existing file.
-
package¶ VM description file to read (and possibly write).
Calls
COT.vm_factory.VMFactory.create()to instantiateself.vmfrom the provided file.Raises: InvalidInputError– if the file does not exist.
-