diff --git a/lib/galaxy/model/orm/scripts.py b/lib/galaxy/model/orm/scripts.py index 1b4e8c14836..fc7b4742c97 100644 --- a/lib/galaxy/model/orm/scripts.py +++ b/lib/galaxy/model/orm/scripts.py @@ -21,6 +21,12 @@ DATABASE = { 'default_sqlite_file': './database/universe.sqlite', 'config_override': 'GALAXY_CONFIG_', }, + "tools": + { + 'repo': 'lib/tool_shed/galaxy_install/migrate', + 'default_sqlite_file': './database/universe.sqlite', + 'config_override': 'GALAXY_CONFIG_', + }, "tool_shed": { 'repo': 'lib/galaxy/webapps/tool_shed/model/migrate', diff --git a/lib/tool_shed/galaxy_install/migrate/check.py b/lib/tool_shed/galaxy_install/migrate/check.py index c95a0d5e3f7..19ea3705d18 100644 --- a/lib/tool_shed/galaxy_install/migrate/check.py +++ b/lib/tool_shed/galaxy_install/migrate/check.py @@ -55,11 +55,10 @@ def verify_tools(app, url, galaxy_config_file=None, engine_options={}): if not app.config.running_functional_tests: if tool_shed_accessible: # Automatically update the value of the migrate_tools.version database table column. - config_arg = '' + cmd = ['sh', 'manage_db.sh', 'upgrade', 'tools'] if galaxy_config_file: - config_arg = " -c %s" % galaxy_config_file - cmd = 'sh manage_tools.sh%s upgrade' % config_arg - proc = subprocess.Popen(args=cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + cmd[2:2] = ['-c', galaxy_config_file] + proc = subprocess.Popen(args=cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) return_code = proc.wait() output = proc.stdout.read(32768) if return_code != 0: diff --git a/manage_tools.sh b/manage_tools.sh deleted file mode 100644 index 234d1d85fd5..00000000000 --- a/manage_tools.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -cd `dirname $0` -: ${GALAXY_VIRTUAL_ENV:=.venv} - -if [ -d "$GALAXY_VIRTUAL_ENV" ]; -then - printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n" - . "$GALAXY_VIRTUAL_ENV/bin/activate" -fi - -python ./scripts/manage_tools.py $@ diff --git a/scripts/manage_tools.py b/scripts/manage_tools.py deleted file mode 100644 index fafc9c6e2be..00000000000 --- a/scripts/manage_tools.py +++ /dev/null @@ -1,39 +0,0 @@ -from __future__ import print_function - -import logging -import os.path -import sys -from ConfigParser import SafeConfigParser - -from migrate.versioning.shell import main - -sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib'))) - -from galaxy.model.orm.scripts import read_config_file_arg -from galaxy.util.properties import load_app_properties - -log = logging.getLogger(__name__) - -config_file = read_config_file_arg(sys.argv, 'config/galaxy.ini', 'universe_wsgi.ini') -if not os.path.exists(config_file): - print("Galaxy config file does not exist (hint: use '-c config.ini' for non-standard locations): %s" % config_file) - sys.exit(1) -repo = 'lib/tool_shed/galaxy_install/migrate' - -properties = load_app_properties(config_file=config_file) -cp = SafeConfigParser() -cp.read(config_file) - -if config_file == 'config/galaxy.ini.sample' and 'GALAXY_TEST_DBURI' in os.environ: - # Running functional tests. - db_url = os.environ['GALAXY_TEST_DBURI'] -elif "install_database_connection" in properties: - db_url = properties["install_database_connection"] -elif "database_connection" in properties: - db_url = properties["database_connection"] -elif "database_file" in properties: - db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % properties["database_file"] -else: - db_url = "sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE" - -main(repository=repo, url=db_url)