blob: f61451b8b127fe8aae71fc0cb8073afea39029f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# Utility functions
from obfuscator.logger import get_logger
class Utilities:
def __init__(self, logger=None):
self.logger = get_logger("UTILITIES", logger)
def get_s3_path(self, uri):
parts = uri.replace("s3://", "").split("/")
self.logger.debug(f"Parts: {parts}")
bucket = parts.pop(0)
self.logger.debug(f"Bucket: {bucket}")
key = "/".join(parts)
self.logger.debug(f"Key: {key}")
return bucket, key
|