Skip to content

Commit ed98d45

Browse files
committed
Changing requirements + formating
1 parent fd5c828 commit ed98d45

File tree

2 files changed

+32
-34
lines changed

2 files changed

+32
-34
lines changed

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ pycryptodome
1818
leechcorepyc>=2.4.0
1919

2020
# This is required for memory analysis on a Amazon/MinIO S3 and Google Cloud object storage
21-
gcsfs>=2023.6.0
22-
s3fs>=2023.6.0
21+
gcsfs>=2023.1.0
22+
s3fs>=2023.1.0

volatility3/framework/layers/cloudstorage.py

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,33 @@
2323

2424
vollog = logging.getLogger(__file__)
2525

26-
class S3FileSystemHandler(resources.VolatilityHandler):
27-
if HAS_S3FS:
28-
@classmethod
29-
def non_cached_schemes(cls) -> List[str]:
30-
return ["s3"]
31-
32-
@staticmethod
33-
def default_open(req: urllib.request.Request) -> Optional[Any]:
34-
"""Handles the request if it's the s3 scheme."""
35-
if req.type == "s3":
36-
object_uri = "://".join(req.full_url.split("://")[1:])
37-
return s3fs.S3FileSystem().open(object_uri)
38-
return None
39-
else:
40-
raise exceptions.LayerException("s3 requirement is missing.")
41-
42-
43-
class GSFileSystemHandler(resources.VolatilityHandler):
44-
if HAS_GCSFS:
45-
@classmethod
46-
def non_cached_schemes(cls) -> List[str]:
47-
return ["gs"]
48-
49-
@staticmethod
50-
def default_open(req: urllib.request.Request) -> Optional[Any]:
51-
"""Handles the request if it's the gs scheme."""
52-
if req.type == "gs":
53-
object_uri = "://".join(req.full_url.split("://")[1:])
54-
return gcsfs.GCSFileSystem().open(object_uri)
55-
return None
56-
else:
57-
raise exceptions.LayerException("gcsfs requirement is missing.")
26+
if HAS_S3FS:
27+
28+
class S3FileSystemHandler(resources.VolatilityHandler):
29+
30+
@classmethod
31+
def non_cached_schemes(cls) -> List[str]:
32+
return ["s3"]
33+
34+
@staticmethod
35+
def default_open(req: urllib.request.Request) -> Optional[Any]:
36+
"""Handles the request if it's the s3 scheme."""
37+
if req.type == "s3":
38+
object_uri = "://".join(req.full_url.split("://")[1:])
39+
return s3fs.S3FileSystem().open(object_uri)
40+
return None
41+
42+
if HAS_GCSFS:
43+
44+
class GSFileSystemHandler(resources.VolatilityHandler):
45+
@classmethod
46+
def non_cached_schemes(cls) -> List[str]:
47+
return ["gs"]
48+
49+
@staticmethod
50+
def default_open(req: urllib.request.Request) -> Optional[Any]:
51+
"""Handles the request if it's the gs scheme."""
52+
if req.type == "gs":
53+
object_uri = "://".join(req.full_url.split("://")[1:])
54+
return gcsfs.GCSFileSystem().open(object_uri)
55+
return None

0 commit comments

Comments
 (0)