From e1fed0af20a6fb7e32a90228fc4662a0a260eae2 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Mon, 2 Apr 2018 02:18:20 +0100 Subject: [PATCH] Rejig configuration deleting again Had second thoughts and deletion should only remove data, not sub hierarchies. If the entire hierarchy needs clearing out, it'll need to be done manually, or by splicing in an empty HierarchicalDict. --- volatility/framework/interfaces/configuration.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/volatility/framework/interfaces/configuration.py b/volatility/framework/interfaces/configuration.py index 213f5edec..eaa774d65 100644 --- a/volatility/framework/interfaces/configuration.py +++ b/volatility/framework/interfaces/configuration.py @@ -148,17 +148,7 @@ class HierarchicalDict(collections.abc.Mapping): subdict = self._subdict[self._key_head(key)] del subdict[self._key_tail(key)] else: - key_head = self._key_head(key) - present = False - if key_head in self._data: - present = True - del self._data[self._key_head(key)] - if key_head in self._subdict: - present = True - del self._subdict[key_head] - if not present: - # Make a call to throw the right exception - del self._data[key_head] + del self._subdict[self._key_head(key)] except KeyError: raise KeyError(key)