Skip to content

Commit

Permalink
Add configuration values to actor metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubek committed Oct 10, 2024
1 parent 78d9f32 commit aa8d079
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions leapp/utils/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def store_workflow_metadata(workflow):
ent.store()


def store_actor_metadata(actor_definition, phase):
def store_actor_metadata(actor_definition, phase, config):
"""
Store the metadata of the given actor given as an ``actor_definition``
object into the database.
Expand All @@ -655,8 +655,11 @@ def store_actor_metadata(actor_definition, phase):
})
_metadata['phase'] = phase

# TODO(dkubek): Is configuration metadata? Does it make sense to include it here?
_metadata['config'] = config

actor_metadata_fields = ('class_name', 'name', 'description', 'phase',
'tags', 'consumes', 'produces', 'config_schemas', 'path')
'tags', 'consumes', 'produces', 'config_schemas', 'config', 'path')
metadata = json.dumps({field: _metadata[field] for field in actor_metadata_fields}, sort_keys=True)
metadata_hash_id = hashlib.sha256(metadata.encode('utf-8')).hexdigest()

Expand Down
4 changes: 3 additions & 1 deletion leapp/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import uuid

from leapp.actors.config import retrieve_config
from leapp.dialogs import RawMessageDialog
from leapp.exceptions import CommandError, MultipleConfigActorsError, WorkflowConfigNotAvailable
from leapp.messaging.answerstore import AnswerStore
Expand Down Expand Up @@ -301,7 +302,8 @@ def run(self, context=None, until_phase=None, until_actor=None, skip_phases_unti
for phase in self._phase_actors:
for stage in phase[1:]:
for actor in stage.actors:
store_actor_metadata(actor, phase[0].name)
actor_config = retrieve_config(actor.config_schemas)
store_actor_metadata(actor, phase[0].name, actor_config)

self._stop_after_phase_requested = False
for phase in self._phase_actors:
Expand Down

0 comments on commit aa8d079

Please sign in to comment.