From 1f5a18d679424563a419d216e2e3353b20683f2c Mon Sep 17 00:00:00 2001 From: k1nd0ne Date: Thu, 30 Nov 2023 11:54:55 +0100 Subject: [PATCH] patch running black --- volatility3/framework/layers/cloudstorage.py | 48 ++++++++++---------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/volatility3/framework/layers/cloudstorage.py b/volatility3/framework/layers/cloudstorage.py index 41afa324d..3f88ef34f 100644 --- a/volatility3/framework/layers/cloudstorage.py +++ b/volatility3/framework/layers/cloudstorage.py @@ -8,12 +8,14 @@ from typing import Optional, Any, List try: import s3fs + HAS_S3FS = True except ImportError: HAS_S3FS = False try: import gcsfs + HAS_GCSFS = True except ImportError: HAS_GCSFS = False @@ -26,30 +28,30 @@ vollog = logging.getLogger(__file__) if HAS_S3FS: class S3FileSystemHandler(resources.VolatilityHandler): - - @classmethod - def non_cached_schemes(cls) -> List[str]: - return ["s3"] + @classmethod + def non_cached_schemes(cls) -> List[str]: + return ["s3"] + + @staticmethod + def default_open(req: urllib.request.Request) -> Optional[Any]: + """Handles the request if it's the s3 scheme.""" + if req.type == "s3": + object_uri = "://".join(req.full_url.split("://")[1:]) + return s3fs.S3FileSystem().open(object_uri) + return None - @staticmethod - def default_open(req: urllib.request.Request) -> Optional[Any]: - """Handles the request if it's the s3 scheme.""" - if req.type == "s3": - object_uri = "://".join(req.full_url.split("://")[1:]) - return s3fs.S3FileSystem().open(object_uri) - return None if HAS_GCSFS: - + class GSFileSystemHandler(resources.VolatilityHandler): - @classmethod - def non_cached_schemes(cls) -> List[str]: - return ["gs"] - - @staticmethod - def default_open(req: urllib.request.Request) -> Optional[Any]: - """Handles the request if it's the gs scheme.""" - if req.type == "gs": - object_uri = "://".join(req.full_url.split("://")[1:]) - return gcsfs.GCSFileSystem().open(object_uri) - return None \ No newline at end of file + @classmethod + def non_cached_schemes(cls) -> List[str]: + return ["gs"] + + @staticmethod + def default_open(req: urllib.request.Request) -> Optional[Any]: + """Handles the request if it's the gs scheme.""" + if req.type == "gs": + object_uri = "://".join(req.full_url.split("://")[1:]) + return gcsfs.GCSFileSystem().open(object_uri) + return None