tmt.steps.cleanup package
Submodules
tmt.steps.cleanup.internal module
- class tmt.steps.cleanup.internal.CleanupInternal(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
CleanupPlugin[CleanupInternalData]Stop and remove all provisioned guests
Store plugin name, data and parent step
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- data: CleanupInternalData
- go(*, guest: Guest, environment: Environment | None = None, logger: Logger) PluginOutcome
Stop and remove guest
- class tmt.steps.cleanup.internal.CleanupInternalData(name: str, how: str, order: int = 50, when: list[str] = <factory>, summary: str | None = None)
Bases:
CleanupStepData
Module contents
- class tmt.steps.cleanup.Cleanup(*, plan: Plan, data: _RawStepData | list[_RawStepData] | None = None, name: str | None = None, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
StepClean up the provisioned guests and prune the workdir.
Stop and remove all guests after the testing is finished. Also takes care of pruning irrelevant files and directories from the workdir so that we do not eat up unnecessary disk space after everything is done.
Note that the
cleanupstep is also run when any of the previous steps failed (for example when the environment preparation was not successful) so that provisioned systems are not kept running and consuming resources.Initialize and check the step data
- DEFAULT_HOW: str = 'tmt'
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- cli_invocations: list['tmt.cli.CliInvocation'] = []
- go(force: bool = False) None
Execute cleanup tasks
- summary() None
Give a concise summary
- wake() None
Wake up the step (process workdir and command line)
- class tmt.steps.cleanup.CleanupPlugin(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
Plugin[CleanupStepDataT,PluginOutcome]Common parent of cleanup plugins
Store plugin name, data and parent step
- classmethod base_command(usage: str, method_class: type[Command] | None = None) Command
Create base click command (common for all cleanup plugins)
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- go(*, guest: Guest, environment: Environment | None = None, logger: Logger) PluginOutcome
Perform actions shared among plugins when beginning their tasks
- how: str = 'tmt'