Skip to content

Commit

Permalink
Update suite_id.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Dec 1, 2021
1 parent 9212912 commit 1e0915b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions metomi/rosie/suite_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,17 +421,17 @@ def _find_vc_file_from_location(location):
loc = Path(location).expanduser().resolve()
if suite_dir_rel_root:
sdrr = Path('~', suite_dir_rel_root).expanduser().resolve()
try:
loc.relative_to(sdrr)
except ValueError:
# Not an installed Cylc8 workflow run directory
pass
else:
# Slightly odd construction = loc + parents
for loc in (loc.relative_to(sdrr) / '_').parents:
vcfilepath = sdrr / loc / SuiteId.VC_FILENAME
if os.access(vcfilepath, os.F_OK | os.R_OK):
return vcfilepath
try:
loc.relative_to(sdrr)
except ValueError:
# Not an installed Cylc8 workflow run directory
pass
else:
# Slightly odd construction = loc + parents
for loc in (loc.relative_to(sdrr) / '_').parents:
vcfilepath = sdrr / loc / SuiteId.VC_FILENAME
if os.access(vcfilepath, os.F_OK | os.R_OK):
return vcfilepath
return None

@staticmethod
Expand Down

0 comments on commit 1e0915b

Please sign in to comment.