tmt.steps.prepare.feature package

Submodules

tmt.steps.prepare.feature.epel module

class tmt.steps.prepare.feature.epel.Epel(*args: Any, **kwargs: Any)

Bases: Feature

Initialize feature data

NAME: str = 'epel'
cli_invocation: 'tmt.cli.CliInvocation' | None = None
classmethod disable(guest: Guest, logger: Logger) None
classmethod enable(guest: Guest, logger: Logger) None

Module contents

class tmt.steps.prepare.feature.Feature(*, parent: PrepareFeature, guest: Guest, logger: Logger)

Bases: Common

Base class for feature prepare plugin implementations

Initialize feature data

NAME: str
cli_invocation: 'tmt.cli.CliInvocation' | None = None
classmethod disable(guest: Guest, logger: Logger) None
classmethod enable(guest: Guest, logger: Logger) None
class tmt.steps.prepare.feature.PrepareFeature(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)

Bases: PreparePlugin[PrepareFeatureData]

Enable or disable common features like repositories on the guest.

Warning

The plugin may be a subject of various limitations, imposed by the fact it uses Ansible to implement some of the features:

  • Ansible 2.17+ no longer supports Python 3.6 and older. Guests where Python 3.7+ is not available cannot be prepared with the feature plugin. 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 using feature plugin from an alternative repository or local build.

Example config:

prepare:
    how: feature
    epel: enabled

Or

prepare:
    how: feature
    epel: disabled

Store plugin name, data and parent step

cli_invocation: 'tmt.cli.CliInvocation' | None = None
essential_requires() list[DependencySimple | DependencyFmfId | DependencyFile]

Collect all essential requirements of the plugin.

Essential requirements of a plugin are necessary for the plugin to perform its basic functionality.

Returns:

a list of requirements.

go(*, guest: Guest, environment: Environment | None = None, logger: Logger) list[PhaseResult]

Prepare the guests

class tmt.steps.prepare.feature.PrepareFeatureData(name: str, how: str, order: int = 50, summary: Optional[str] = None, where: list[str] = <factory>, epel: Optional[str] = None)

Bases: PrepareStepData

epel: str | None = None
tmt.steps.prepare.feature.find_plugin(name: str) type[Feature]

Find a plugin by its name.

Raises:

GeneralError – when the plugin does not exist.

tmt.steps.prepare.feature.provides_feature(feature: str) Callable[[type[Feature]], type[Feature]]

A decorator for registering feature plugins. Decorate a feature plugin class to register a feature.