fix: [server] fix install + catch file_compressor error

pull/8/head
Terrtia 2019-02-13 16:22:19 +01:00
parent 1d32603378
commit 0abe815e3e
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 5 additions and 2 deletions

View File

@ -3,7 +3,7 @@
set -e
set -x
sudo apt-get install python3-pip virtualenv screen whois unzip -y
sudo apt-get install python3-pip virtualenv screen whois unzip libffi-dev -y
if [ -z "$VIRTUAL_ENV" ]; then
virtualenv -p python3 D4ENV

View File

@ -31,7 +31,10 @@ def compress_file(file_full_path, session_uuid,i=0):
with open(file_full_path, 'rb') as f_in:
with gzip.open(compressed_filename, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)
os.remove(file_full_path)
try:
os.remove(file_full_path)
except FileNotFoundError:
pass
# save full path in anylyzer queue
for analyzer_uuid in redis_server_metadata.smembers('analyzer:{}'.format(type)):
analyzer_uuid = analyzer_uuid.decode()