mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-16 22:38:18 +00:00
Filter snapshots directory during the snapshot, Fixes: #1297
This commit is contained in:
@ -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"):
|
||||
|
Reference in New Issue
Block a user