Skip to content

Commit

Permalink
Fix regression from #371
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Aug 21, 2019
1 parent 9b89842 commit 1d89899
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions avalon/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,9 +1224,8 @@ def path_from_represenation():
# Template references unavailable data
return None

dirname = os.path.dirname(path)
if os.path.isdir(dirname):
return os.path.normpath(dirname)
if os.path.exists(path):
return os.path.normpath(path)

def path_from_config():
try:
Expand Down Expand Up @@ -1267,18 +1266,16 @@ def path_from_config():
log.debug("Template references unavailable data: %s" % e)
return None

dirname = os.path.dirname(path)
if os.path.isdir(dirname):
return os.path.normpath(dirname)
if os.path.exists(path):
return os.path.normpath(path)

def path_from_data():
if "path" not in representation["data"]:
return None

path = representation["data"]["path"]
dirname = os.path.dirname(path)
if os.path.isdir(dirname):
return os.path.normpath(dirname)
if os.path.exists(path):
return os.path.normpath(path)

return (
path_from_represenation() or
Expand Down

0 comments on commit 1d89899

Please sign in to comment.