Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions augur/application/cli/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os import environ, chmod, path, getenv
import logging
from sys import exit
from subprocess import call
from subprocess import check_call
import random
import string
import click
Expand Down Expand Up @@ -280,7 +280,7 @@
"""
Get the version of the configured database
"""
call(["alembic", "current"])
check_call(["alembic", "current"])


@cli.command("upgrade-db-version")
Expand All @@ -290,7 +290,7 @@
"""
Upgrade the configured database to the latest version
"""
call(["alembic", "upgrade", "head"])
check_call(["alembic", "upgrade", "head"])


@cli.command("check-for-upgrade")
Expand All @@ -300,7 +300,7 @@
"""
Upgrade the configured database to the latest version
"""
call(["alembic", "history", "-i"])
check_call(["alembic", "history", "-i"])


@cli.command("create-schema")
Expand All @@ -310,7 +310,7 @@
"""
Create schema in the configured database
"""
call(["alembic", "upgrade", "head"])
check_call(["alembic", "upgrade", "head"])


def generate_key(length):
Expand Down Expand Up @@ -443,24 +443,24 @@
}
}
check_pgpass_credentials(config)
run_db_creation_psql_command(

Check warning on line 446 in augur/application/cli/db.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable) Raw Output: augur/application/cli/db.py:446:4: E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable)
host, port, default_user, default_db_name, f"CREATE DATABASE {target_db_name};"
)
run_db_creation_psql_command(

Check warning on line 449 in augur/application/cli/db.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable) Raw Output: augur/application/cli/db.py:449:4: E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable)
host,
port,
default_user,
default_db_name,
f"CREATE USER {target_user} WITH ENCRYPTED PASSWORD '{target_password}';",
)
run_db_creation_psql_command(

Check warning on line 456 in augur/application/cli/db.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable) Raw Output: augur/application/cli/db.py:456:4: E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable)
host,
port,
default_user,
default_db_name,
f"ALTER DATABASE {target_db_name} OWNER TO {target_user};",
)
run_db_creation_psql_command(

Check warning on line 463 in augur/application/cli/db.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable) Raw Output: augur/application/cli/db.py:463:4: E0602: Undefined variable 'run_db_creation_psql_command' (undefined-variable)
host,
port,
default_user,
Expand Down Expand Up @@ -513,7 +513,7 @@
db_conn_string = f"postgresql+psycopg2://{db_config['user']}:{db_config['password']}@{db_config['host']}:{db_config['port']}/{db_config['database_name']}"
engine = s.create_engine(db_conn_string)

call(
check_call(
[
"psql",
"-h",
Expand All @@ -521,9 +521,9 @@
"-d",
database_name,
"-U",
user,

Check warning on line 524 in augur/application/cli/db.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0602: Undefined variable 'user' (undefined-variable) Raw Output: augur/application/cli/db.py:524:12: E0602: Undefined variable 'user' (undefined-variable)
"-p",
port,

Check warning on line 526 in augur/application/cli/db.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0602: Undefined variable 'port' (undefined-variable) Raw Output: augur/application/cli/db.py:526:12: E0602: Undefined variable 'port' (undefined-variable)
"-a",
"-w",
target_type,
Expand Down
Loading