Fix base path for monkey download after refactor

This commit is contained in:
Daniel Goldberg 2018-10-14 16:35:18 +03:00
parent 10d21a4fd4
commit f39ee62668
1 changed files with 5 additions and 5 deletions

View File

@ -1,15 +1,14 @@
import logging
import json import json
import logging
import os import os
from flask import request, send_from_directory
import flask_restful import flask_restful
from flask import request, send_from_directory
__author__ = 'Barak' __author__ = 'Barak'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
MONKEY_DOWNLOADS = [ MONKEY_DOWNLOADS = [
{ {
'type': 'linux', 'type': 'linux',
@ -81,7 +80,8 @@ class MonkeyDownload(flask_restful.Resource):
result = get_monkey_executable(host_os.get('type'), host_os.get('machine')) result = get_monkey_executable(host_os.get('type'), host_os.get('machine'))
if result: if result:
real_path = os.path.join('binaries', result['filename']) # change resulting from new base path
real_path = os.path.join("monkey_island", "cc", 'binaries', result['filename'])
if os.path.isfile(real_path): if os.path.isfile(real_path):
result['size'] = os.path.getsize(real_path) result['size'] = os.path.getsize(real_path)
return result return result