Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass --raw or --raw-except=datalad to addurl #34

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Before running `backups2datalad`, the following setup must be performed:
required.

- [git-annex](https://git-annex.branchable.com) must be installed. At least
version 10.20230126 is required, though you should endeavor to obtain the
version 10.20240227 is required, though you should endeavor to obtain the
yarikoptic marked this conversation as resolved.
Show resolved Hide resolved
latest version.

- An API token needs to be obtained for the DANDI instance that is being
Expand Down
9 changes: 8 additions & 1 deletion src/backups2datalad/asyncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ async def get_annex_hash(self, filepath: Path) -> str:
async def ensure_addurl(self) -> None:
async with self.addurl_lock:
if self.addurl is None:
env = os.environ.copy()
if self.embargoed:
env["DATALAD_dandi_token"] = self.manager.token
opts = ["--raw-except=datalad"]
else:
opts = ["--raw"]
self.addurl = await open_git_annex(
"addurl",
"-c",
Expand All @@ -390,8 +396,9 @@ async def ensure_addurl(self) -> None:
"--json",
"--json-error-messages",
"--json-progress",
*opts,
path=self.ds.pathobj,
env={**os.environ, "DATALAD_dandi_token": self.manager.token},
env=env,
)
self.nursery.start_soon(self.feed_addurl)
self.nursery.start_soon(self.read_addurl)
Expand Down