Skip to content

Commit

Permalink
Fix missing index file check
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Dec 1, 2017
1 parent b03f16e commit c0887d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/tool_shed/galaxy_install/install_manager.py
Expand Up @@ -532,7 +532,7 @@ def __handle_repository_contents(self, tool_shed_repository, tool_path, reposito
stdtm.install_tool_data_tables(tool_shed_repository, tool_index_sample_files)
if tool_data_table_elems:
self.app.tool_data_tables.add_new_entries_from_config_file(tool_data_table_conf_filename,
self.app.config.shed_tool_data_path,
None,
self.app.config.shed_tool_data_table_config,
persist=True)
if 'tools' in irmm_metadata_dict:
Expand Down
5 changes: 3 additions & 2 deletions lib/tool_shed/tools/data_table_manager.py
Expand Up @@ -90,7 +90,7 @@ def handle_missing_data_table_entry(self, relative_install_dir, tool_path, repos
self.reset_tool_data_tables()
return repository_tools_tups

def handle_sample_tool_data_table_conf_file(self, filename, persist=False):
def handle_sample_tool_data_table_conf_file(self, filename, persist=False, tool_data_tables=None):
"""
Parse the incoming filename and add new entries to the in-memory
self.app.tool_data_tables dictionary. If persist is True (should
Expand All @@ -100,8 +100,9 @@ def handle_sample_tool_data_table_conf_file(self, filename, persist=False):
"""
error = False
message = ''
tdtm = tool_data_tables or self.tdtm
try:
new_table_elems, message = self.tdtm \
new_table_elems, message = tdtm \
.add_new_entries_from_config_file(config_filename=filename,
tool_data_path=self.app.config.shed_tool_data_path,
shed_tool_data_table_config=self.app.config.shed_tool_data_table_config,
Expand Down
7 changes: 4 additions & 3 deletions lib/tool_shed/tools/tool_validator.py
Expand Up @@ -72,7 +72,8 @@ def check_tool_input_params(self, repo_dir, tool_config_name, tool, sample_files
if sample_tool_data_table_conf:
error, correction_msg = \
self.stdtm.handle_sample_tool_data_table_conf_file(sample_tool_data_table_conf,
persist=False)
persist=False,
tool_data_tables=tool.app.tool_data_tables)
if error:
invalid_files_and_errors_tups.append(('tool_data_table_conf.xml.sample', correction_msg))
else:
Expand All @@ -82,9 +83,9 @@ def check_tool_input_params(self, repo_dir, tool_config_name, tool, sample_files
invalid_tup = (tool_config_name, correction_msg)
if invalid_tup not in invalid_files_and_errors_tups:
invalid_files_and_errors_tups.append(invalid_tup)
if options.index_file or options.missing_index_file:
if options.index_file or options.tool_data_table and options.tool_data_table.missing_index_file:
# Make sure the repository contains the required xxx.loc.sample file.
index_file = options.index_file or options.missing_index_file
index_file = options.index_file or options.tool_data_table.missing_index_file
index_file_name = basic_util.strip_path(index_file)
sample_found = False
for sample_file in sample_files:
Expand Down

0 comments on commit c0887d7

Please sign in to comment.