Skip to content

Commit

Permalink
FIX: make sure out_root is always defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Sep 2, 2019
1 parent 0bb96d0 commit 157072b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions databroker/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1898,12 +1898,14 @@ def export(self, headers, db, new_root=None, copy_kwargs=None):
db.mds.insert_run_stop(**_sanitize(header['stop']))
# insert assets
res_uids = self.get_resource_uids(header)

for uid in res_uids:
fps = self.reg.copy_files(uid, new_root=new_root,
**copy_kwargs)
file_pairs.extend(fps)
res = self.reg.resource_given_uid(uid)
r_path = res['resource_path']
out_root = new_root
if os.path.isabs(r_path):
if not res['root']:
r_path = os.path.relpath(r_path, os.path.sep)
Expand Down

0 comments on commit 157072b

Please sign in to comment.