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

get: no relpath on output not found #2435

Merged
merged 3 commits into from Sep 6, 2019
Merged
Changes from 1 commit
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
22 changes: 16 additions & 6 deletions dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,22 @@ class OutputNotFoundError(DvcException):
output (unicode): path to the file/directory.
"""

def __init__(self, output):
super(OutputNotFoundError, self).__init__(
"unable to find DVC-file with output '{path}'".format(
path=relpath(output)
)
)
def __init__(self, out):
import tempfile
import fnmatch
import os

msg = "unable to find DVC-file with output '{}'".format(relpath(out))

def is_dvc_repo(out):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify what is going on? This looks really obscure.

tempdir = tempfile.gettempdir()
pattern = os.path.join(tempdir, "*dvc-repo*")
return fnmatch.fnmatch(out, pattern)

if is_dvc_repo(out):
msg = "unable to find DVC-file with given output path"

super(OutputNotFoundError, self).__init__(msg)


class StagePathAsOutputError(DvcException):
Expand Down