Skip to content
Snippets Groups Projects
Commit e067afd6 authored by Jérémy Bobbio (Lunar)'s avatar Jérémy Bobbio (Lunar)
Browse files

Allow `swh db init` to work on pipeline configurations

This avoids having to use two separate configuration files for
initializing and then running a storage instance.
parent 57ff37b9
No related branches found
1 merge request!387Allow `swh db init` to work on pipeline configurations
Pipeline #9440 failed
......@@ -482,6 +482,10 @@ def db_upgrade(ctx, module, dbname, to_version, interactive, module_config_key):
def get_dburl_from_config(cfg):
if cfg["cls"] == "pipeline":
# We know the database itself will always
# come last in a pipeline configuration.
cfg = cfg["steps"][-1]
if cfg.get("cls") != "postgresql":
raise click.BadParameter(
"Configuration cls must be set to 'postgresql' for this command."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment