Skip to content

Commit

Permalink
stateengine plugin: important fix when logging wrongly defined item f…
Browse files Browse the repository at this point in the history
…or action
  • Loading branch information
onkelandy committed Sep 11, 2024
1 parent a4576e8 commit 3537c36
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion stateengine/StateEngineAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ def complete(self, state, action_type, evals_items=None, use=None):
self._abitem.set_variable('current.state_name', state.name)
self._action_type = action_type
self._state = state

self._item, self._status, self._mindelta, self._value, _issue = self.check_complete(
state, self._item, self._status, self._mindelta, self._value, "set/force", evals_items, use)
self._action_status = _issue
Expand Down
4 changes: 2 additions & 2 deletions stateengine/StateEngineActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def complete(self, state, action_type, evals_items=None, use=None):
_status.update(self.__actions[name].complete(state, action_type, evals_items, use))
except ValueError as ex:
_status.update({name: {'issue': ex, 'issueorigin': {'state': state.id, 'action': 'unknown'}}})
raise ValueError("State '{0}', Action '{1}': {2}".format(state.id, name, ex))
raise ValueError("Completing State '{0}', Action '{1}': {2}".format(state.id, name, ex))
self._log_debug("Completing {} for state {} status {}", self.__actions, state, _status)
return _status

Expand All @@ -538,7 +538,7 @@ def set(self, value):
try:
self.__actions[name].update(value)
except ValueError as ex:
raise ValueError("State '{0}', Action '{1}': {2}".format(value.property.path, name, ex))
raise ValueError("Setting State '{0}', Action '{1}': {2}".format(value.property.path, name, ex))

# Execute all actions
# is_repeat: Indicate if this is a repeated action without changing the state
Expand Down
2 changes: 1 addition & 1 deletion stateengine/StateEngineItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2131,7 +2131,7 @@ def return_item(self, item_id):
_, _, item = item.partition(":")
return item, None
elif match:
_issue = ("Item '{0}' has to be defined as an item path "
_issue = ("Item '{}' has to be defined as an item path "
"or eval expression without {}.").format(match.group(1), item_id)
self.__logger.warning(_issue)
return None, [_issue]
Expand Down

0 comments on commit 3537c36

Please sign in to comment.