Skip to content

Commit

Permalink
add compression
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Descamps <[email protected]>
  • Loading branch information
lefred committed Apr 26, 2022
1 parent 69985f2 commit fd865cd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion support/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
from support import fetch
from support.collections import *

try:
import shutil
zip_present=True
except:
print("Module shutil is not present, final compression won't be available.")
zip_present=False


def _is_mds(session):
stmt = "select @@version_comment"
result = session.run_sql(stmt)
Expand Down Expand Up @@ -75,4 +83,11 @@ def get_collect_info(mysql=True, os=False, time=10, outputdir="~", session=None)
print("We will also collect MDS specific information.")
runCollection(session, time, common.collectMDSList)

runCollection(session, time, common.collectList)
runCollection(session, time, common.collectList)
if zip_present:
answer = shell.prompt(
'Do you want to compress the collected data ? (Y/n) ', {'defaultValue': 'y'})
if answer.lower() == 'y':
shutil.make_archive(common.outdir, "zip", common.outdir)
shutil.rmtree(common.outdir)

0 comments on commit fd865cd

Please sign in to comment.