tmt.steps.finish package
Submodules
tmt.steps.finish.ansible module
- class tmt.steps.finish.ansible.FinishAnsible(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
FinishPlugin
[FinishStepData
],PrepareAnsible
Perform finishing tasks using ansible
Single playbook config:
finish: how: ansible playbook: ansible/packages.yml
Multiple playbooks config:
finish: how: ansible playbook: - playbook/one.yml - playbook/two.yml - playbook/three.yml
The playbook path should be relative to the metadata tree root. Use ‘order’ attribute to select in which order finishing tasks should happen if there are multiple configs. Default order is ‘50’.
Store plugin name, data and parent step
- classmethod base_command(usage: str, method_class: type[click.core.Command] | None = None) Command
Create base click command (common for all finish plugins)
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
tmt.steps.finish.shell module
- class tmt.steps.finish.shell.FinishShell(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
FinishPlugin
[FinishShellData
]Perform finishing tasks using shell (bash) scripts
Example config:
finish: how: shell script: - upload-logs.sh || true - rm -rf /tmp/temporary-files
Use the ‘order’ attribute to select in which order finishing tasks should happen if there are multiple configs. Default order is ‘50’.
Store plugin name, data and parent step
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- go(*, guest: Guest, environment: Environment | None = None, logger: Logger) None
Perform finishing tasks on given guest
- class tmt.steps.finish.shell.FinishShellData(name: str, how: str, order: int = 50, summary: Optional[str] = None, where: list[str] = <factory>, script: list[tmt.utils.ShellScript] = <factory>)
Bases:
FinishStepData
- script: list[tmt.utils.ShellScript]
- to_spec() dict[str, Any]
Convert to a form suitable for saving in a specification file
Module contents
- class tmt.steps.finish.Finish(*, plan: Plan, data: _RawStepData | list[tmt.steps._RawStepData] | None = None, name: str | None = None, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
Step
Perform the finishing tasks and clean up provisioned guests.
Additional actions to be performed after the test execution has been completed. Counterpart of the
prepare
step useful for various cleanup actions. Also takes care of stopping and removing guests.Note that the
finish
step 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.Initialize and check the step data
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- cli_invocations: list['tmt.cli.CliInvocation'] = []
- go(force: bool = False) None
Execute finishing tasks
- summary() None
Give a concise summary
- wake() None
Wake up the step (process workdir and command line)
- class tmt.steps.finish.FinishPlugin(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
Plugin
[FinishStepDataT
]Common parent of finish plugins
Store plugin name, data and parent step
- classmethod base_command(usage: str, method_class: type[click.core.Command] | None = None) Command
Create base click command (common for all finish plugins)
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- class tmt.steps.finish.FinishStepData(name: str, how: str, order: int = 50, summary: Optional[str] = None, where: list[str] = <factory>)
Bases:
WhereableStepData
,StepData