Skip to content

Commit

Permalink
stateengine plugin: massive update of se_use handling. Now the item c…
Browse files Browse the repository at this point in the history
…onfig gets correctly scanned and only at init. Multiple fixes, improvements and better issue handling
  • Loading branch information
onkelandy committed Jul 30, 2024
1 parent 88b91c6 commit 8bc09e2
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 107 deletions.
5 changes: 3 additions & 2 deletions stateengine/StateEngineActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,10 @@ def __raise_missing_parameter_error(self, parameter, param_name):

# Check the actions optimize and complete them
# state: state (item) to read from
def complete(self, state, evals_items=None):
def complete(self, state, evals_items=None, use=None):
_status = {}
use = state.use.get()
if use is None:
use = state.use.get()
for name in self.__actions:
try:
_status.update(self.__actions[name].complete(state, evals_items, use))
Expand Down
5 changes: 3 additions & 2 deletions stateengine/StateEngineConditionSets.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def update(self, name, item, grandparent_item):

# Check the condition sets, optimize and complete them
# state: item (item) to read from
def complete(self, state):
use = state.use.get()
def complete(self, state, use=None):
if use is None:
use = state.use.get()
for name in self.__condition_sets:
self.__condition_sets[name].complete(state, use)

Expand Down
6 changes: 5 additions & 1 deletion stateengine/StateEngineItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,11 @@ def list_issues(v):
if value.get('attribute'):
self.__logger.info("Attribute {}", value.get('attribute'))
self.__logger.increase_indent()
self.__logger.info("defined in state {}", entry)
if value.get('origin'):
origin = value.get('origin')
else:
origin = "state"
self.__logger.info("defined in {} {}", origin, entry)
self.__logger.decrease_indent()
list_issues(value)
else:
Expand Down
Loading

0 comments on commit 8bc09e2

Please sign in to comment.