diff --git a/jdbc_utils.py b/jdbc_utils.py index 327c78afe..38e545b90 100644 --- a/jdbc_utils.py +++ b/jdbc_utils.py @@ -8,8 +8,7 @@ def get_jdbc_credentials(dbi_url): username = match.group('username') password = match.group('password') return (jdbc_url, username, password) - return None - + return (None, None, None) def remove_credentials(error): message = "ERROR:" diff --git a/tasks.py b/tasks.py index 946b26ae3..4959614a7 100644 --- a/tasks.py +++ b/tasks.py @@ -185,7 +185,7 @@ def deploy(ctx, space=None, branch=None, login=None, yes=False, migrate_database print("\nSkipping migrations. Database not migrated.\n") else: migration_env_var = 'FEC_MIGRATOR_SQLA_CONN_{0}'.format(space.upper()) - migration_conn = os.getenv(migration_env_var) + migration_conn = os.getenv(migration_env_var, '') jdbc_url, migration_user, migration_password = get_jdbc_credentials( migration_conn ) @@ -231,8 +231,8 @@ def create_sample_db(ctx): print("Loading schema...") db_conn = os.getenv('SQLA_SAMPLE_DB_CONN') - jdbc_url = get_jdbc_credentials(db_conn) - run_migrations(ctx, jdbc_url) + jdbc_url, migration_user, migration_password = get_jdbc_credentials(db_conn) + run_migrations(ctx, jdbc_url, migration_user, migration_password) print("Schema loaded") print("Loading sample data...") diff --git a/tests/conftest.py b/tests/conftest.py index a9f728e74..99173a82d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,7 +14,7 @@ def migrate_db(request): def run_migrations(): subprocess.check_call( - ['flyway', 'migrate', '-n', '-url=%s' % get_test_jdbc_url(), '-locations=filesystem:data/migrations'],) + ['flyway', 'migrate', '-n', '-url={0}'.format(get_test_jdbc_url()), '-locations=filesystem:data/migrations'],) def reset_schema(): for schema in [