From ec1529dcb9b0b2a67b6e84a62314dab456fee80a Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Mon, 6 Apr 2015 18:53:33 -0500 Subject: [PATCH] Add in requirement checking to plugins. --- volatility/framework/config.py | 1 + volatility/framework/interfaces/plugins.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/volatility/framework/config.py b/volatility/framework/config.py index ccba64a26..fad25fb0f 100644 --- a/volatility/framework/config.py +++ b/volatility/framework/config.py @@ -37,6 +37,7 @@ class ListRequirement(GenericRequirement): self.max_elements = max_elements def check_value(self, value, context): + """Check the types on each of the returned values and then call the element type's check for each one""" self._type_check(value, list) if not all([self._type_check(element, self.element_type) for element in value]): raise TypeError("At least one element in the list is not of the correct type.") diff --git a/volatility/framework/interfaces/plugins.py b/volatility/framework/interfaces/plugins.py index e01774b98..a224d7d4d 100644 --- a/volatility/framework/interfaces/plugins.py +++ b/volatility/framework/interfaces/plugins.py @@ -34,11 +34,12 @@ class PluginInterface(validity.ValidityRoutines, metaclass = ABCMeta): @abstractmethod def requirements(self): - """Returns a ConfigGroup object to contain the required options""" + """Returns a list of requirements options""" pass def check_requirements(self): - pass + for requirement in self.requirements(): + requirement.check_value(requirement.value, self._context) @abstractmethod def __call__(self, context):