From bde2288da02ee6d978611c0da2b7e972fc76bb70 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 27 Jan 2021 12:23:39 +0200 Subject: [PATCH] Minor fixes: Removed debugging log and improved readability in PBA path const --- monkey/monkey_island/cc/resources/pba_file_upload.py | 1 - monkey/monkey_island/cc/services/post_breach_files.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/resources/pba_file_upload.py b/monkey/monkey_island/cc/resources/pba_file_upload.py index fc3a6f6c8..5f75eaaa1 100644 --- a/monkey/monkey_island/cc/resources/pba_file_upload.py +++ b/monkey/monkey_island/cc/resources/pba_file_upload.py @@ -39,7 +39,6 @@ class FileUpload(flask_restful.Resource): filename = ConfigService.get_config_value(copy.deepcopy(PBA_LINUX_FILENAME_PATH)) else: filename = ConfigService.get_config_value(copy.deepcopy(PBA_WINDOWS_FILENAME_PATH)) - LOG.info(f"Current dir:{os.getcwd()}") return send_from_directory(ABS_UPLOAD_PATH, filename) @jwt_required diff --git a/monkey/monkey_island/cc/services/post_breach_files.py b/monkey/monkey_island/cc/services/post_breach_files.py index 49c38e076..2bb310e14 100644 --- a/monkey/monkey_island/cc/services/post_breach_files.py +++ b/monkey/monkey_island/cc/services/post_breach_files.py @@ -6,6 +6,8 @@ import monkey_island.cc.services.config __author__ = "VakarisZ" +from monkey_island.cc.consts import MONKEY_ISLAND_ABS_PATH + logger = logging.getLogger(__name__) # Where to find file names in config @@ -14,8 +16,7 @@ PBA_LINUX_FILENAME_PATH = ['monkey', 'post_breach', 'PBA_linux_filename'] UPLOADS_DIR_NAME = 'userUploads' -_PBA_UPLOAD_PATH = [os.getcwd(), 'monkey_island', 'cc', UPLOADS_DIR_NAME] -ABS_UPLOAD_PATH = Path(*_PBA_UPLOAD_PATH) +ABS_UPLOAD_PATH = Path(MONKEY_ISLAND_ABS_PATH, 'cc', UPLOADS_DIR_NAME) def remove_PBA_files():