leapp.workflows package¶
Submodules¶
leapp.workflows.flags module¶
leapp.workflows.phaseactors module¶
leapp.workflows.phases module¶
-
class
leapp.workflows.phases.
Phase
¶ Bases:
leapp.workflows.phases.with_meta_base_object_PhaseMeta
-
filter
= None¶
-
flags
= <leapp.workflows.flags.Flags object>¶
-
classmethod
get_index
()¶
-
name
= None¶
-
policies
= <leapp.workflows.policies.Policies object>¶
-
classmethod
serialize
()¶ Returns: Dictionary with the serialized representation of the phase
-
leapp.workflows.policies module¶
-
class
leapp.workflows.policies.
Policies
(error=<class 'leapp.workflows.policies.ReportOnly'>, retry=<class 'leapp.workflows.policies.Disabled'>)¶ Bases:
object
-
class
Errors
¶ Bases:
object
-
class
FailImmediately
¶ Bases:
object
-
class
FailPhase
¶ Bases:
object
-
class
ReportOnly
¶ Bases:
object
-
class
-
class
Retry
¶ Bases:
object
-
class
Actor
¶ Bases:
object
-
class
Disabled
¶ Bases:
object
-
class
Phase
¶ Bases:
object
-
class
-
serialize
()¶
-
class
leapp.workflows.tagfilters module¶
Module contents¶
-
class
leapp.workflows.
Workflow
(logger=None, auto_reboot=False)¶ Bases:
leapp.workflows.with_meta_base_object_WorkflowMeta
Workflow is the base class for all workflow definitions.
Parameters: logger (Instance of logging.Logger
) – Optional logger to be used instead of leapp.workflow-
answer_store
¶ : return: AnswerStore instance used for messaging
-
configuration
= None¶ Model to be used as workflow configuration
-
consumes
¶ All consumed messages
-
description
= ''¶ Documentation for the workflow
-
dialogs
¶ All encountered dialogs
-
errors
¶ Returns: All reported errors
-
experimental_whitelist
¶ Whitelist of actors that may be executed even that they are marked experimental
-
failure
¶
-
initial
¶ Initial messages required
-
is_valid_phase
(phase=None)¶
-
load_answers
(answerfile_path, userchoices_path)¶
-
name
= None¶ Name of the workflow
-
phase_actors
¶ Return all actors for the phase
-
phases
= ()¶
-
produces
¶ All produced messages
-
run
(context=None, until_phase=None, until_actor=None, skip_phases_until=None, skip_dialogs=False, only_with_tags=None)¶ Executes the workflow
Parameters: - context (str) – Custom execution ID to be used instead of a randomly generated UUIDv4
- until_phase (str) – Specify until including which phase the execution should run - phase.stage can be used to control it even more granularly. phase is any phase name where stage refers to main, before or after. If no stage is defined, after is assumed to be the default value. The execution ends when this phase (and stage, if specified) has been executed.
- until_actor (str) – The execution finishes when this actor has been executed.
- skip_phases_until (str or None) – Skips all phases until including the phase specified, and then continues the execution.
- skip_dialogs (bool) – Inform actors about the mode of dialogs processing. If skip_dialogs is set to True it means that dialogs can’t be processed in the current workflow run interactively and every attempted call of get_answers api method will be non-blocking, returning an empty dict if no user choice was found in answerfile or a selected option otherwise. If skip_dialogs is set to False then in case of absent recorded answer the dialog will be rendered in a blocking user input requiring way. The value of skip_dialogs will be passed to the actors that can theoretically use it for their purposes.
- only_with_tags (List[str]) – Executes only actors with the given tag, any other actor is going to get skipped.
-
save_answers
(answerfile_path, userchoices_path)¶ Generates an answer file for the dialogs of the workflow and saves it to answerfile_path. Updates a .userchoices file at userchoices_path with new answers encountered in answerfile.
Parameters: - answerfile_path – The path where to store the answer file.
- userchoices_path – The path where to store the .userchoices file.
Returns: None
-
classmethod
serialize
()¶ Returns: Serialized form of the workflow
-
short_name
= None¶ Short name of the workflow
-
tag
= None¶ Workflow Tag
-
whitelist_experimental_actor
(actor)¶ Adds an actor to the experimental whitelist and allows them to be executed.
Parameters: actor (class derived from py:class:leapp.actors.Actor) – Actor to be whitelisted Returns: None
-
-
class
leapp.workflows.
WorkflowMeta
¶ Bases:
type
Meta class for the registration of workflows
-
leapp.workflows.
actor_names
(actor=None)¶
-
leapp.workflows.
contains_tag
(needle_tags, actor_tags)¶
-
leapp.workflows.
get_workflows
()¶ Returns: all registered workflows
-
leapp.workflows.
phase_names
(phase=None)¶
-
leapp.workflows.
tag_names
(tag=None)¶