Skip to content
Snippets Groups Projects
Commit 09f7ec3e authored by John Chilton's avatar John Chilton
Browse files

Update metadata directory handling for Galaxy-ism.

Working directory is below metadata directory in Galaxy 16.04 - so need to handle that.
parent 92481ac9
No related branches found
No related tags found
No related merge requests found
from os.path import abspath, basename, join, exists from os.path import abspath, basename, join, exists
from os.path import isdir
from os.path import dirname from os.path import dirname
from os.path import relpath from os.path import relpath
from os import listdir, sep from os import listdir, sep
...@@ -199,17 +200,17 @@ class FileStager(object): ...@@ -199,17 +200,17 @@ class FileStager(object):
self.transfer_tracker.handle_transfer(path, path_type.METADATA) self.transfer_tracker.handle_transfer(path, path_type.METADATA)
def __working_directory_files(self): def __working_directory_files(self):
if self.working_directory and exists(self.working_directory): return self.__list_files(self.working_directory)
return listdir(self.working_directory)
else:
return []
def __metadata_directory_files(self): def __metadata_directory_files(self):
if self.metadata_directory and exists(self.metadata_directory): return self.__list_files(self.metadata_directory)
return listdir(self.metadata_directory)
else: def __list_files(self, directory):
if not directory or not exists(directory):
return [] return []
return [f for f in listdir(directory) if exists(f) and isdir(f)]
def __initialize_version_file_rename(self): def __initialize_version_file_rename(self):
version_file = self.version_file version_file = self.version_file
if version_file: if version_file:
......
...@@ -127,6 +127,7 @@ def run(options): ...@@ -127,6 +127,7 @@ def run(options):
temp_shared_dir = os.path.join(temp_directory, "shared", "test1") temp_shared_dir = os.path.join(temp_directory, "shared", "test1")
temp_work_dir = os.path.join(temp_directory, "w") temp_work_dir = os.path.join(temp_directory, "w")
temp_metadata_dir = os.path.join(temp_directory, "m") temp_metadata_dir = os.path.join(temp_directory, "m")
temp_false_working_dir = os.path.join(temp_metadata_dir, "working")
temp_tool_dir = os.path.join(temp_directory, "t") temp_tool_dir = os.path.join(temp_directory, "t")
__makedirs([ __makedirs([
...@@ -136,6 +137,7 @@ def run(options): ...@@ -136,6 +137,7 @@ def run(options):
temp_index_dir_sibbling, temp_index_dir_sibbling,
temp_shared_dir, temp_shared_dir,
temp_metadata_dir, temp_metadata_dir,
temp_false_working_dir,
]) ])
temp_input_path = os.path.join(temp_directory, "dataset_0.dat") temp_input_path = os.path.join(temp_directory, "dataset_0.dat")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment