mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-06 17:57:38 +02:00
Remove long-broken convenience code from ConfigurableInterface.
In the dim and distant past, I seemingly thought it a good idea to copy all the values out of an object's config and into local private attributes (I guess to avoid config lookups?). It turns out, it was always broken because it looking at the root of the config tree, rather than under the object's specific config settings. This first turned up as an issue where self._meta_layer was being overwritten by None in the vmware layer. Removing this resolved the issue.
This commit is contained in:
@@ -114,6 +114,8 @@ class LayerStacker(interfaces.automagic.AutomagicInterface):
|
||||
new_layer = stacker.stack(new_context, current_layer_name, progress_callback)
|
||||
if new_layer:
|
||||
new_context.memory.add_layer(new_layer)
|
||||
vollog.log(constants.LOGLEVEL_VVVV,
|
||||
"Stacked {} using {}".format(new_layer.name, stacker_cls.__name__))
|
||||
break
|
||||
except Exception as excp:
|
||||
# Stacking exceptions are likely only of interest to developers, so the lowest level of logging
|
||||
|
||||
@@ -465,13 +465,6 @@ class ConfigurableInterface(validity.ValidityRoutines, metaclass = ABCMeta):
|
||||
self._context = self._check_type(context, ContextInterface)
|
||||
self._config_path = self._check_type(config_path, str)
|
||||
|
||||
# Store these programmatically, so we don't keep repreating the requirements
|
||||
# This also allows constructed objects to populate a configuration without too much trouble
|
||||
for requirement in self.get_requirements():
|
||||
# Create the (private) properties using the config as backend storage
|
||||
# TODO: Based on the requirement, do proper type checking
|
||||
setattr(self, "_" + requirement.name, self._context.config.get(requirement.name, requirement.default))
|
||||
|
||||
@property
|
||||
def context(self) -> 'interfaces.context.ContextInterface':
|
||||
return self._context
|
||||
|
||||
Reference in New Issue
Block a user