forked from p15670423/monkey
Island: Rename get_file_contents() -> get_text_file_contents()
This commit is contained in:
parent
b7a113fb14
commit
f80e53aca1
|
@ -3,7 +3,7 @@ from pathlib import Path
|
||||||
|
|
||||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||||
from monkey_island.cc.resources.request_authentication import jwt_required
|
from monkey_island.cc.resources.request_authentication import jwt_required
|
||||||
from monkey_island.cc.server_utils.file_utils import get_file_contents
|
from monkey_island.cc.server_utils.file_utils import get_text_file_contents
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -17,6 +17,6 @@ class IslandLog(AbstractResource):
|
||||||
@jwt_required
|
@jwt_required
|
||||||
def get(self):
|
def get(self):
|
||||||
try:
|
try:
|
||||||
return get_file_contents(self._island_log_file_path)
|
return get_text_file_contents(self._island_log_file_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error("Monkey Island logs failed to download", exc_info=True)
|
logger.error("Monkey Island logs failed to download", exc_info=True)
|
||||||
|
|
|
@ -21,7 +21,7 @@ if is_windows_os():
|
||||||
import monkey_island.cc.server_utils.windows_permissions as windows_permissions
|
import monkey_island.cc.server_utils.windows_permissions as windows_permissions
|
||||||
|
|
||||||
|
|
||||||
def get_file_contents(file_path: Path) -> str:
|
def get_text_file_contents(file_path: Path) -> str:
|
||||||
with open(file_path, "rt") as f:
|
with open(file_path, "rt") as f:
|
||||||
file_contents = f.read()
|
file_contents = f.read()
|
||||||
return file_contents
|
return file_contents
|
||||||
|
|
Loading…
Reference in New Issue