예제 #1
0
 def load_tool_from_config(self, repository_id, full_path):
     tool_source = get_tool_source(
         full_path,
         enable_beta_formats=getattr(self.app.config,
                                     "enable_beta_tool_formats", False),
         tool_location_fetcher=ToolLocationFetcher(),
     )
     try:
         tool = create_tool_from_source(config_file=full_path,
                                        app=self.app,
                                        tool_source=tool_source,
                                        repository_id=repository_id,
                                        allow_code_files=False)
         valid = True
         error_message = None
     except KeyError as e:
         tool = None
         valid = False
         error_message = 'This file requires an entry for "%s" in the tool_data_table_conf.xml file.  Upload a file ' % str(
             e)
         error_message += 'named tool_data_table_conf.xml.sample to the repository that includes the required entry to correct '
         error_message += 'this error.  '
         log.exception(error_message)
     except Exception as e:
         tool = None
         valid = False
         error_message = str(e)
         log.exception('Caught exception loading tool from %s:', full_path)
     return tool, valid, error_message
예제 #2
0
 def load_tool_from_config(self, repository_id, full_path):
     tool_source = get_tool_source(
         full_path,
         enable_beta_formats=getattr(self.app.config, "enable_beta_tool_formats", False),
         tool_location_fetcher=ToolLocationFetcher(),
     )
     try:
         tool = create_tool_from_source(config_file=full_path, app=self.app, tool_source=tool_source, repository_id=repository_id, allow_code_files=False)
         valid = True
         error_message = None
     except KeyError as e:
         tool = None
         valid = False
         error_message = 'This file requires an entry for "%s" in the tool_data_table_conf.xml file.  Upload a file ' % str(e)
         error_message += 'named tool_data_table_conf.xml.sample to the repository that includes the required entry to correct '
         error_message += 'this error.  '
     except Exception as e:
         tool = None
         valid = False
         error_message = str(e)
     return tool, valid, error_message