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],PrepareAnsiblePerform finishing tasks using ansible
Warning
The plugin may be a subject of various limitations, imposed by Ansible itself:
Ansible 2.17+ no longer supports Python 3.6 and older. Guests where Python 3.7+ is not available cannot be prepared with the
ansibleplugin. This has been observed when Fedora Rawhide runner is used with CentOS 7 or CentOS Stream 8 guests. Possible workarounds: downgrade Ansible tmt uses, or install Python 3.7+ before usingansibleplugin from an alternative repository or local build.
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[Command] | None = None) Command
Create base click command (common for all finish plugins)
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- go(*, guest: Guest, environment: Environment | None = None, logger: Logger) list[PhaseResult]
Prepare the guests
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) list[PhaseResult]
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[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[_RawStepData] | None = None, name: str | None = None, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
StepPerform the finishing tasks and clean up provisioned guests.
Additional actions to be performed after the test execution has been completed. Counterpart of the
preparestep useful for various cleanup actions. Also takes care of stopping and removing guests.Note that the
finishstep 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,list[PhaseResult]]Common parent of finish 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 finish plugins)
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- go(*, guest: Guest, environment: Environment | None = None, logger: Logger) list[PhaseResult]
Perform actions shared among plugins when beginning their tasks
- class tmt.steps.finish.FinishStepData(name: str, how: str, order: int = 50, summary: Optional[str] = None, where: list[str] = <factory>)
Bases:
WhereableStepData,StepData