33from os import environ , chmod , path , getenv
44import logging
55from sys import exit
6- from subprocess import call
6+ from subprocess import check_call
77import random
88import string
99import click
@@ -280,7 +280,7 @@ def print_db_version():
280280 """
281281 Get the version of the configured database
282282 """
283- call (["alembic" , "current" ])
283+ check_call (["alembic" , "current" ])
284284
285285
286286@cli .command ("upgrade-db-version" )
@@ -290,7 +290,7 @@ def upgrade_db_version():
290290 """
291291 Upgrade the configured database to the latest version
292292 """
293- call (["alembic" , "upgrade" , "head" ])
293+ check_call (["alembic" , "upgrade" , "head" ])
294294
295295
296296@cli .command ("check-for-upgrade" )
@@ -300,7 +300,7 @@ def check_for_upgrade():
300300 """
301301 Upgrade the configured database to the latest version
302302 """
303- call (["alembic" , "history" , "-i" ])
303+ check_call (["alembic" , "history" , "-i" ])
304304
305305
306306@cli .command ("create-schema" )
@@ -310,7 +310,7 @@ def create_schema():
310310 """
311311 Create schema in the configured database
312312 """
313- call (["alembic" , "upgrade" , "head" ])
313+ check_call (["alembic" , "upgrade" , "head" ])
314314
315315
316316def generate_key (length ):
@@ -513,7 +513,7 @@ def run_psql_command_in_database(target_type, target):
513513 db_conn_string = f"postgresql+psycopg2://{ db_config ['user' ]} :{ db_config ['password' ]} @{ db_config ['host' ]} :{ db_config ['port' ]} /{ db_config ['database_name' ]} "
514514 engine = s .create_engine (db_conn_string )
515515
516- call (
516+ check_call (
517517 [
518518 "psql" ,
519519 "-h" ,
0 commit comments