mirror of https://github.com/D4-project/d4-core
fix: [server] fix install + catch file_compressor error
parent
1d32603378
commit
0abe815e3e
|
@ -3,7 +3,7 @@
|
||||||
set -e
|
set -e
|
||||||
set -x
|
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
|
if [ -z "$VIRTUAL_ENV" ]; then
|
||||||
virtualenv -p python3 D4ENV
|
virtualenv -p python3 D4ENV
|
||||||
|
|
|
@ -31,7 +31,10 @@ def compress_file(file_full_path, session_uuid,i=0):
|
||||||
with open(file_full_path, 'rb') as f_in:
|
with open(file_full_path, 'rb') as f_in:
|
||||||
with gzip.open(compressed_filename, 'wb') as f_out:
|
with gzip.open(compressed_filename, 'wb') as f_out:
|
||||||
shutil.copyfileobj(f_in, f_out)
|
shutil.copyfileobj(f_in, f_out)
|
||||||
|
try:
|
||||||
os.remove(file_full_path)
|
os.remove(file_full_path)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
# save full path in anylyzer queue
|
# save full path in anylyzer queue
|
||||||
for analyzer_uuid in redis_server_metadata.smembers('analyzer:{}'.format(type)):
|
for analyzer_uuid in redis_server_metadata.smembers('analyzer:{}'.format(type)):
|
||||||
analyzer_uuid = analyzer_uuid.decode()
|
analyzer_uuid = analyzer_uuid.decode()
|
||||||
|
|
Loading…
Reference in New Issue