From e99fd8d41916da4195b48d3b07c980d2fea73a06 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Mon, 23 Dec 2024 16:08:31 +0000 Subject: [PATCH] Linux: Fix minor typos --- .../framework/plugins/linux/mountinfo.py | 2 +- .../framework/symbols/linux/__init__.py | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/volatility3/framework/plugins/linux/mountinfo.py b/volatility3/framework/plugins/linux/mountinfo.py index d7e1f68d2..6c43d04b6 100644 --- a/volatility3/framework/plugins/linux/mountinfo.py +++ b/volatility3/framework/plugins/linux/mountinfo.py @@ -10,7 +10,7 @@ from volatility3.framework import renderers, interfaces from volatility3.framework.configuration import requirements from volatility3.framework.interfaces import plugins from volatility3.framework.symbols import linux -from volatility3.framework.symbols.linux.utilities import linux_paths +from volatility3.framework.symbols.linux.utilities import paths as linux_paths from volatility3.plugins.linux import pslist diff --git a/volatility3/framework/symbols/linux/__init__.py b/volatility3/framework/symbols/linux/__init__.py index fa152768c..d0d1c0a46 100644 --- a/volatility3/framework/symbols/linux/__init__.py +++ b/volatility3/framework/symbols/linux/__init__.py @@ -81,6 +81,25 @@ class LinuxKernelIntermedSymbols(intermed.IntermediateSymbolTable): self.optional_set_type_class("maple_tree", extensions.maple_tree) +def deprecation_warning(method): + """Warning to prevent people using old methods""" + + _warn_skips = (os.path.dirname(__file__),) + + @functools.wraps(method) + def deprecated_method(*args, **kwargs): + warnings.warn( + "Plugin is using " + f"{'LinuxUtilities.' + method.__name__}, please report a bug to the plugin author asking them to use {method.__qualname__}", + FutureWarning, + stacklevel=2, + skip_file_prefixes=_warn_skips, + ) + return method(*args, **kwargs) + + return deprecated_method + + class LinuxUtilities(interfaces.configuration.VersionableInterface): """Class with multiple useful linux functions.""" @@ -89,25 +108,6 @@ class LinuxUtilities(interfaces.configuration.VersionableInterface): framework.require_interface_version(*_required_framework_version) - @staticmethod - def deprecation_warning(method): - """Warning to prevent people using old methods""" - - _warn_skips = (os.path.dirname(__file__),) - - @functools.wraps(method) - def deprecated_method(*args, **kwargs): - warnings.warn( - "Plugin is using " - f"{'LinuxUtilities.' + method.__name__}, please report a bug to the plugin author asking them to use {method.__qualname__}", - FutureWarning, - stacklevel=2, - skip_file_prefixes=_warn_skips, - ) - return method(*args, **kwargs) - - return deprecated_method - do_get_path = deprecation_warning(paths.Paths.do_get_path) get_path_mnt = deprecation_warning(paths.Paths.get_path_mnt) path_for_file = deprecation_warning(paths.Paths.path_for_file)