Skip to content

Commit

Permalink
Export package for correct vault in API
Browse files Browse the repository at this point in the history
  • Loading branch information
lordi committed Jun 12, 2017
1 parent 7d8f2d2 commit 10966d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion syncrypt/api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def dispatch_export(self, request):
if os.path.isdir(path):
path = os.path.join(path, '{0}.zip'.format(vault.config.id))

yield from self.app.export_package(path)
yield from self.app.export_package(path, vault=vault)

return JSONResponse({'status': 'ok', 'filename': path})

Expand Down
5 changes: 3 additions & 2 deletions syncrypt/app/syncrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,9 @@ def import_package(self, filename, target_folder, pull_vault=False):
return vault

@asyncio.coroutine
def export_package(self, filename):
vault = self.vaults[0]
def export_package(self, filename, vault=None):
if vault is None:
vault = self.vaults[0]
export_pipe = vault.package_info()
if filename is None:
export_pipe = export_pipe >> StdoutWriter()
Expand Down

0 comments on commit 10966d7

Please sign in to comment.