Skip to content

Commit

Permalink
Removed SQLite store container types restriction (#3866)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Oct 15, 2021
1 parent 8abede2 commit 747c2f8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
8 changes: 0 additions & 8 deletions plaso/storage/sqlite/sqlite_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,12 +1053,7 @@ def GetNumberOfAttributeContainers(self, container_type):
Raises:
IOError: when there is an error querying the storage file.
OSError: when there is an error querying the storage file.
ValueError: if an unsupported container type is provided.
"""
if not container_type in self._CONTAINER_TYPES:
raise ValueError('Attribute container type {0:s} is not supported'.format(
container_type))

if not self._HasTable(container_type):
return 0

Expand Down Expand Up @@ -1140,9 +1135,6 @@ def HasAttributeContainers(self, container_type):
IOError: when there is an error querying the storage file.
OSError: when there is an error querying the storage file.
"""
if not container_type in self._CONTAINER_TYPES:
return False

count = self.GetNumberOfAttributeContainers(container_type)
return count > 0

Expand Down
3 changes: 0 additions & 3 deletions tests/storage/sqlite/sqlite_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,6 @@ def testGetNumberOfAttributeContainers(self):
event_data_stream.CONTAINER_TYPE)
self.assertEqual(number_of_containers, 1)

with self.assertRaises(ValueError):
test_store.GetNumberOfAttributeContainers('bogus')

# Test for a supported container type that does not have a table
# present in the storage file.
query = 'DROP TABLE {0:s}'.format(event_data_stream.CONTAINER_TYPE)
Expand Down

0 comments on commit 747c2f8

Please sign in to comment.