Skip to content

Commit 47bfa87

Browse files
authored
Merge pull request #20449 from mvdbeek/set_galaxy_config_file_env_var
[25.0] Set ``GALAXY_CONFIG_FILE`` env var if starting handler with `-c`
2 parents 01209e1 + f0383dc commit 47bfa87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/galaxy_main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ def main(func=app_loop):
225225
args = arg_parser.parse_args()
226226
if args.ini_path and not args.config_file:
227227
args.config_file = args.ini_path
228+
if (config_file_env := os.environ.get("GALAXY_CONFIG_FILE")) and os.path.abspath(
229+
config_file_env
230+
) != os.path.abspath(args.config_file):
231+
sys.exit(
232+
"Error: GALAXY_CONFIG_FILE environment variable is set to a different config file than the one specified on the command line."
233+
)
234+
os.environ["GALAXY_CONFIG_FILE"] = os.path.abspath(args.config_file)
228235
if args.log_file:
229236
os.environ["GALAXY_CONFIG_LOG_DESTINATION"] = os.path.abspath(args.log_file)
230237
if args.server_name:

0 commit comments

Comments
 (0)