diff --git a/tmt/base.py b/tmt/base.py index fef49009e2..b473de39b2 100644 --- a/tmt/base.py +++ b/tmt/base.py @@ -343,16 +343,30 @@ def create_adjust_callback(logger: tmt.log.Logger) -> fmf.base.AdjustCallback: def callback( node: fmf.Tree, rule: _RawAdjustRule, - applied: bool) -> None: - if applied is False: - return + applied: Optional[bool]) -> None: + if applied is None: + logger.verbose( + f"Adjust rule **skipped** on '{node.name}'", + tmt.utils.format_value(rule, key_color='green'), + color='cyan', + level=3, + topic=tmt.log.Topic.ADJUST_DECISIONS) + + elif applied is False: + logger.verbose( + f"Adjust rule **not applied** to '{node.name}'", + tmt.utils.format_value(rule, key_color='green'), + color='red', + level=3, + topic=tmt.log.Topic.ADJUST_DECISIONS) - logger.verbose( - f"Adjust rule applied to '{node.name}'", - tmt.utils.format_value(rule, key_color='green'), - color='cyan', - level=3, - topic=tmt.log.Topic.ADJUST_RULINGS) + else: + logger.verbose( + f"Adjust rule **applied** to '{node.name}'", + tmt.utils.format_value(rule, key_color='green'), + color='green', + level=3, + topic=tmt.log.Topic.ADJUST_DECISIONS) return callback @@ -2615,7 +2629,7 @@ def tree(self) -> fmf.Tree: # Adjust metadata for current fmf context self._tree.adjust( fmf.context.Context(**self._fmf_context), - on_rule=create_adjust_callback(self._logger)) + decision_callback=create_adjust_callback(self._logger)) return self._tree @tree.setter @@ -3906,7 +3920,7 @@ def resolve_dynamic_ref( raise tmt.utils.FileError("Cannot get plan fmf context to evaluate dynamic ref.") reference_tree.adjust( fmf.context.Context(**plan._fmf_context), - on_rule=create_adjust_callback(logger)) + decision_callback=create_adjust_callback(logger)) # Also temporarily build a plan so that env and context variables are expanded Plan(logger=logger, node=reference_tree, run=plan.my_run, skip_validation=True) ref = reference_tree.get("ref") diff --git a/tmt/log.py b/tmt/log.py index f31a5b12d4..324bd6a9ca 100644 --- a/tmt/log.py +++ b/tmt/log.py @@ -51,7 +51,7 @@ class Topic(enum.Enum): KEY_NORMALIZATION = 'key-normalization' CLI_INVOCATIONS = 'cli-invocations' - ADJUST_RULINGS = 'adjust-rulings' + ADJUST_DECISIONS = 'adjust-decisions' DEFAULT_TOPICS: Set[Topic] = set()