Skip to content

Commit e71791c

Browse files
committed
Set server_name before using it
Otherwise the `pid_file` is set to the wrong filename, preventing `LocalGalaxyConfig.kill()` from working when running Galaxy under Python 3. Follow-up to galaxyproject#874 .
1 parent e163f44 commit e71791c

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

planemo/galaxy/config.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,12 @@ def config_join(*args):
367367
_build_eggs_cache(ctx, install_env, kwds)
368368
_install_galaxy(ctx, galaxy_root, install_env, kwds)
369369

370-
server_name = "planemo%d" % random.randint(0, 100000)
370+
if parse_version(kwds.get('galaxy_python_version') or DEFAULT_PYTHON_VERSION) >= parse_version('3'):
371+
# on python 3 we use gunicorn,
372+
# which requires 'main' as server name
373+
server_name = 'main'
374+
else:
375+
server_name = "planemo%d" % random.randint(0, 100000)
371376
# Once we don't have to support earlier than 18.01 - try putting these files
372377
# somewhere better than with Galaxy.
373378
log_file = "%s.log" % server_name
@@ -407,10 +412,6 @@ def config_join(*args):
407412
)
408413
_ensure_directory(shed_tool_path)
409414
port = _get_port(kwds)
410-
if parse_version(kwds.get('galaxy_python_version') or DEFAULT_PYTHON_VERSION) >= parse_version('3'):
411-
# on python 3 we use gunicorn,
412-
# which requires 'main' as server name
413-
server_name = 'main'
414415
template_args = dict(
415416
port=port,
416417
host=kwds.get("host", "127.0.0.1"),

planemo/galaxy/serve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _serve(ctx, runnables, **kwds):
4141

4242
with galaxy_config(ctx, runnables, **kwds) as config:
4343
cmd = config.startup_command(ctx, **kwds)
44-
action = "Starting galaxy"
44+
action = "Starting Galaxy"
4545
exit_code = run_galaxy_command(
4646
ctx,
4747
cmd,

0 commit comments

Comments
 (0)