Skip to content

Commit

Permalink
Fix tuple assignment for get_jdbc_credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-upchurch authored and lbeaufort committed Jun 24, 2019
1 parent 6d3809e commit 77e504e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions jdbc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
6 changes: 3 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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...")
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 77e504e

Please sign in to comment.