Skip to content

Commit

Permalink
Changes to handle multiple system configuations log2timeline#2286 (lo…
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz authored and rgayon committed Apr 24, 2023
1 parent 65bf867 commit 333009d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plaso/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ def PreprocessSource(

system_configuration = artifacts.SystemConfigurationArtifact(
code_page=mediator.code_page, language=mediator.language)
system_configuration.environment_variables = (
# Ensure environment_variables is a list otherwise serialization will
# fail.
system_configuration.environment_variables = list(
mediator.GetEnvironmentVariables())
system_configuration.hostname = mediator.hostname
system_configuration.keyboard_layout = mediator.GetValue(
Expand Down
8 changes: 7 additions & 1 deletion plaso/storage/sqlite/sqlite_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ def _SerializeAttributeContainer(self, container):
json_dict['_event_data_stream_identifier'] = (
event_data_stream_identifier.CopyToString())

serialized_string = json.dumps(json_dict)
try:
serialized_string = json.dumps(json_dict)
except TypeError as exception:
raise IOError((
'Unable to serialize attribute container: {0:s} with error: '
'{1!s}.').format(container.CONTAINER_TYPE, exception))

if not serialized_string:
raise IOError('Unable to serialize attribute container: {0:s}.'.format(
container.CONTAINER_TYPE))
Expand Down

0 comments on commit 333009d

Please sign in to comment.