File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,9 +89,18 @@ def ensure_dcg_exists(
8989 if not windows_path :
9090 logger .warning ("No atlas metadata path found" )
9191 return None
92- visit_index = windows_path .split ("\\ " ).index (environment .visit )
93- partial_path = "/" .join (windows_path .split ("\\ " )[visit_index + 1 :])
94- logger .info ("Partial Linux path successfully constructed from Windows path" )
92+ if environment .visit in windows_path .split ("\\ " ):
93+ # Case of atlas in the correct location
94+ visit_index = windows_path .split ("\\ " ).index (environment .visit )
95+ partial_path = "/" .join (windows_path .split ("\\ " )[visit_index + 1 :])
96+ logger .info (
97+ f"Partial Linux path successfully constructed from Windows path: { partial_path } "
98+ )
99+ else :
100+ # Atlas not in visit, so come up with where it should have been
101+ # Assumes /structure/to/Supervisor/Sample/Atlas/Atlas.dm
102+ partial_path = "/" .join (windows_path .split ("\\ " )[- 4 :])
103+ logger .info (f"Partial Linux path estimated: { partial_path } " )
95104
96105 logger .info (
97106 f"Looking for atlas XML file in metadata directory { str ((source_visit_dir / partial_path ).parent )} "
You can’t perform that action at this time.
0 commit comments