Skip to content

Commit

Permalink
Renamed ReadPreprocessingInformation to ReadSystemConfiguration log2t…
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed May 24, 2020
1 parent 8f945d7 commit b2c9601
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 53 deletions.
2 changes: 1 addition & 1 deletion plaso/cli/pinfo_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def _PrintPreprocessingInformation(
"""
knowledge_base_object = knowledge_base.KnowledgeBase()

storage_reader.ReadPreprocessingInformation(knowledge_base_object)
storage_reader.ReadSystemConfiguration(knowledge_base_object)

lookup_identifier = session_identifier
if lookup_identifier:
Expand Down
4 changes: 2 additions & 2 deletions plaso/multi_processing/psort.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def AnalyzeEvents(
# the ZIP storage file will remain locked as long as the worker processes
# are alive.
storage_writer.Open()
storage_writer.ReadPreprocessingInformation(knowledge_base_object)
storage_writer.ReadSystemConfiguration(knowledge_base_object)
storage_writer.WriteSessionStart()

try:
Expand Down Expand Up @@ -984,7 +984,7 @@ def ExportEvents(
self._processing_configuration = processing_configuration
self._status_update_callback = status_update_callback

storage_reader.ReadPreprocessingInformation(knowledge_base_object)
storage_reader.ReadSystemConfiguration(knowledge_base_object)

total_number_of_events = 0
for session in storage_reader.GetSessions():
Expand Down
12 changes: 5 additions & 7 deletions plaso/storage/fake/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,14 @@ def PrepareMergeTaskStorage(self, task):
task.identifier))

# pylint: disable=unused-argument
def ReadPreprocessingInformation(self, knowledge_base):
"""Reads preprocessing information.
def ReadSystemConfiguration(self, knowledge_base):
"""Reads system configuration information.
The preprocessing information contains the system configuration which
contains information about various system specific configuration data,
for example the user accounts.
The system configuration contains information about various system specific
configuration data, for example the user accounts.
Args:
knowledge_base (KnowledgeBase): is used to store the preprocessing
information.
knowledge_base (KnowledgeBase): is used to store the system configuration.
Raises:
IOError: if the storage type does not support writing preprocessing
Expand Down
28 changes: 12 additions & 16 deletions plaso/storage/file_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,18 +405,16 @@ def HasWarnings(self):
"""
return self._storage_file.HasWarnings()

def ReadPreprocessingInformation(self, knowledge_base):
"""Reads preprocessing information.
def ReadSystemConfiguration(self, knowledge_base):
"""Reads system configuration information.
The preprocessing information contains the system configuration which
contains information about various system specific configuration data,
for example the user accounts.
The system configuration contains information about various system specific
configuration data, for example the user accounts.
Args:
knowledge_base (KnowledgeBase): is used to store the preprocessing
information.
knowledge_base (KnowledgeBase): is used to store the system configuration.
"""
self._storage_file.ReadPreprocessingInformation(knowledge_base)
self._storage_file.ReadSystemConfiguration(knowledge_base)

def SetSerializersProfiler(self, serializers_profiler):
"""Sets the serializers profiler.
Expand Down Expand Up @@ -882,16 +880,14 @@ def PrepareMergeTaskStorage(self, task):
'Unable to rename task storage file: {0:s} with error: '
'{1!s}').format(processed_storage_file_path, exception))

def ReadPreprocessingInformation(self, knowledge_base):
"""Reads preprocessing information.
def ReadSystemConfiguration(self, knowledge_base):
"""Reads system configuration information.
The preprocessing information contains the system configuration which
contains information about various system specific configuration data,
for example the user accounts.
The system configuration contains information about various system specific
configuration data, for example the user accounts.
Args:
knowledge_base (KnowledgeBase): is used to store the preprocessing
information.
knowledge_base (KnowledgeBase): is used to store the system configuration.
Raises:
IOError: when the storage writer is closed.
Expand All @@ -900,7 +896,7 @@ def ReadPreprocessingInformation(self, knowledge_base):
if not self._storage_file:
raise IOError('Unable to read from closed storage writer.')

self._storage_file.ReadPreprocessingInformation(knowledge_base)
self._storage_file.ReadSystemConfiguration(knowledge_base)

def RemoveProcessedTaskStorage(self, task):
"""Removes a processed task storage.
Expand Down
36 changes: 15 additions & 21 deletions plaso/storage/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,14 @@ def HasEventTags(self):
def Open(self, **kwargs):
"""Opens the storage."""

def ReadPreprocessingInformation(self, knowledge_base):
"""Reads preprocessing information.
def ReadSystemConfiguration(self, knowledge_base):
"""Reads system configuration information.
The preprocessing information contains the system configuration which
contains information about various system specific configuration data,
for example the user accounts.
The system configuration contains information about various system specific
configuration data, for example the user accounts.
Args:
knowledge_base (KnowledgeBase): is used to store the preprocessing
information.
knowledge_base (KnowledgeBase): is used to store the system configuration.
"""
generator = self._GetAttributeContainers(
self._CONTAINER_TYPE_SYSTEM_CONFIGURATION)
Expand Down Expand Up @@ -802,16 +800,14 @@ def HasWarnings(self):
"""

@abc.abstractmethod
def ReadPreprocessingInformation(self, knowledge_base):
"""Reads preprocessing information.
def ReadSystemConfiguration(self, knowledge_base):
"""Reads system configuration information.
The preprocessing information contains the system configuration which
contains information about various system specific configuration data,
for example the user accounts.
The system configuration contains information about various system specific
configuration data, for example the user accounts.
Args:
knowledge_base (KnowledgeBase): is used to store the preprocessing
information.
knowledge_base (KnowledgeBase): is used to store the system configuration.
"""

@abc.abstractmethod
Expand Down Expand Up @@ -1033,16 +1029,14 @@ def PrepareMergeTaskStorage(self, task):
raise NotImplementedError()

@abc.abstractmethod
def ReadPreprocessingInformation(self, knowledge_base):
"""Reads preprocessing information.
def ReadSystemConfiguration(self, knowledge_base):
"""Reads system configuration information.
The preprocessing information contains the system configuration which
contains information about various system specific configuration data,
for example the user accounts.
The system configuration contains information about various system specific
configuration data, for example the user accounts.
Args:
knowledge_base (KnowledgeBase): is used to store the preprocessing
information.
knowledge_base (KnowledgeBase): is used to store the system configuration.
"""

# pylint: disable=unused-argument
Expand Down
8 changes: 4 additions & 4 deletions tests/multi_processing/psort.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def testInternalAnalyzeEvents(self):
storage_writer.StartTaskStorage()

storage_writer.Open()
storage_writer.ReadPreprocessingInformation(knowledge_base_object)
storage_writer.ReadSystemConfiguration(knowledge_base_object)

# TODO: implement, this currently loops infinite.
# test_engine._AnalyzeEvents(storage_writer, [test_plugin])
Expand All @@ -343,7 +343,7 @@ def testInternalAnalyzeEvents(self):
storage_writer.StartTaskStorage()

storage_writer.Open()
storage_writer.ReadPreprocessingInformation(knowledge_base_object)
storage_writer.ReadSystemConfiguration(knowledge_base_object)

# TODO: implement, this currently loops infinite.
_ = test_engine
Expand Down Expand Up @@ -379,7 +379,7 @@ def testInternalExportEvents(self):

storage_reader = (
storage_factory.StorageFactory.CreateStorageReaderForFile(temp_file))
storage_reader.ReadPreprocessingInformation(knowledge_base_object)
storage_reader.ReadSystemConfiguration(knowledge_base_object)

test_engine._ExportEvents(
storage_reader, output_module, deduplicate_events=False)
Expand Down Expand Up @@ -412,7 +412,7 @@ def testInternalExportEventsDeduplicate(self):

storage_reader = (
storage_factory.StorageFactory.CreateStorageReaderForFile(temp_file))
storage_reader.ReadPreprocessingInformation(knowledge_base_object)
storage_reader.ReadSystemConfiguration(knowledge_base_object)

test_engine._ExportEvents(storage_reader, output_module)

Expand Down
2 changes: 1 addition & 1 deletion tests/output/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _CreateOutputMediator(self, storage_file=None):
knowledge_base_object = knowledge_base.KnowledgeBase()

if storage_file:
storage_file.ReadPreprocessingInformation(knowledge_base_object)
storage_file.ReadSystemConfiguration(knowledge_base_object)

formatter_mediator = formatters_mediator.FormatterMediator()
output_mediator = mediator.OutputMediator(
Expand Down
2 changes: 1 addition & 1 deletion tests/storage/sqlite/sqlite_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def testGetSortedEvents(self):

# TODO: add tests for Open and Close

# TODO: add tests for ReadPreprocessingInformation
# TODO: add tests for ReadSystemConfiguration
# TODO: add tests for WritePreprocessingInformation

def testWriteSessionStartAndCompletion(self):
Expand Down

0 comments on commit b2c9601

Please sign in to comment.