Filter snapshots directory during the snapshot, Fixes: #1297

This commit is contained in:
ziajka
2018-02-28 16:33:20 +01:00
parent 9e73ca6620
commit 9be76d98a2
2 changed files with 46 additions and 1 deletions

View File

@ -29,7 +29,8 @@ log = logging.getLogger(__name__)
@asyncio.coroutine
def export_project(project, temporary_dir, include_images=False, keep_compute_id=False, allow_all_nodes=False):
def export_project(project, temporary_dir, include_images=False, keep_compute_id=False,
allow_all_nodes=False, ignore_prefixes=None):
"""
Export the project as zip. It's a ZipStream object.
The file will be read chunk by chunk when you iterate on
@ -111,6 +112,10 @@ def _filter_files(path):
if path.endswith("snapshots"):
return True
# filter directory of snapshots
if "{sep}snapshots{sep}".format(sep=os.path.sep) in path:
return True
try:
i = s.index("project-files")
if s[i + 1] in ("tmp", "captures", "snapshots"):