From daa6583b0815ccadab396479834b2f2ce3982497 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 31 May 2022 13:16:50 -0400 Subject: [PATCH] Island: Refactor IFileRepository imports/exports Export `IFileRepository` and `LocalStorageFileRepository` from `repository/file_storage` so that the `repository` package does not depend on the internal structure of the `file_storage` subpackage. --- monkey/monkey_island/cc/repository/__init__.py | 3 +-- monkey/monkey_island/cc/repository/file_storage/__init__.py | 2 ++ .../repository/file_storage/local_storage_file_repository.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/repository/__init__.py b/monkey/monkey_island/cc/repository/__init__.py index d12e4b150..ed332bdd2 100644 --- a/monkey/monkey_island/cc/repository/__init__.py +++ b/monkey/monkey_island/cc/repository/__init__.py @@ -1,2 +1 @@ -from .file_storage.local_storage_file_repository import LocalStorageFileRepository -from .file_storage.i_file_repository import IFileRepository, FileRetrievalError +from .file_storage import FileRetrievalError, IFileRepository, LocalStorageFileRepository diff --git a/monkey/monkey_island/cc/repository/file_storage/__init__.py b/monkey/monkey_island/cc/repository/file_storage/__init__.py index e69de29bb..30b59b5d9 100644 --- a/monkey/monkey_island/cc/repository/file_storage/__init__.py +++ b/monkey/monkey_island/cc/repository/file_storage/__init__.py @@ -0,0 +1,2 @@ +from .i_file_repository import IFileRepository, FileRetrievalError +from .local_storage_file_repository import LocalStorageFileRepository diff --git a/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py b/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py index ec765b4e7..c21846582 100644 --- a/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py +++ b/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py @@ -6,7 +6,7 @@ from typing import BinaryIO from common.utils.file_utils import get_all_regular_files_in_directory from monkey_island.cc.server_utils.file_utils import create_secure_directory -from .i_file_repository import FileRetrievalError, IFileRepository +from . import FileRetrievalError, IFileRepository logger = logging.getLogger(__name__)