Skip to content

Commit 3604fee

Browse files
committed
RegEx is evil...
1 parent 33c5b64 commit 3604fee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

layersbox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def update_adapter(config, service_directory, service_name):
564564
# parse nginx.conf of all services to get a list of all proxied containers
565565
#TODO: make sure to only read URLs after a "proxy_pass"
566566
with open(join(service_directory, service_name, "nginx.conf")) as f:
567-
for w in re.findall('(https?:\/\/[A-Za-z0-9]+)',f.read()):
567+
for w in re.findall('(https?:\/\/[A-Za-z0-9.]+)',f.read()):
568568
proxied_servers.append(w.replace('http://', ''))
569569

570570
# now get the IPs of the proxied containers
@@ -714,7 +714,7 @@ 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)) as infile:
717+
with open(join(servicedir, service_name, env_file[0])) as infile:
718718
for line in infile:
719719
if "_DB_NAME" in line:
720720
db_key = line.split("_DB_NAME=")[0]
@@ -737,7 +737,7 @@ def create_databases(dir, service_name, database_env_files):
737737
mysqlcreate_output = subprocess.check_output(["docker-compose", "run", "mysqlcreate"])
738738
db_password = mysqlcreate_output.split(" -p")[1].split(" -hmysql")[0]
739739
# write password to env file
740-
with open(join(servicedir, service_name, env_file), "a") as outfile:
740+
with open(join(servicedir, service_name, env_file[0]), "a") as outfile:
741741
outfile.write("{}_DB_PASS={}".format(db_key, db_password))
742742

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

0 commit comments

Comments
 (0)