Skip to content

Commit a779a26

Browse files
committed
Merge pull request #2 from learning-layers/env_file_fix
Fix for env_file[0] causing error when installing openidconnect
2 parents f0449f9 + cf7e499 commit a779a26

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

layersbox

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,9 @@ def create_databases(dir, service_name, database_env_files):
714714
db_username = ""
715715
db_file = ""
716716
db_exists = False
717-
with open(join(servicedir, service_name, env_file[0])) as infile:
717+
if isinstance(env_file, (tuple, list)):
718+
env_file = env_file[0]
719+
with open(join(servicedir, service_name, env_file)) as infile:
718720
for line in infile:
719721
if "_DB_NAME" in line:
720722
db_key = line.split("_DB_NAME=")[0]
@@ -737,7 +739,7 @@ def create_databases(dir, service_name, database_env_files):
737739
mysqlcreate_output = subprocess.check_output(["docker-compose", "run", "mysqlcreate"])
738740
db_password = mysqlcreate_output.split(" -p")[1].split(" -hmysql")[0]
739741
# write password to env file
740-
with open(join(servicedir, service_name, env_file[0]), "a") as outfile:
742+
with open(join(servicedir, service_name, env_file), "a") as outfile:
741743
outfile.write("\n{}_DB_PASS={}".format(db_key, db_password))
742744

743745
# clean up and delete secret.env content, otherwise db is created again

0 commit comments

Comments
 (0)