Skip to content
Snippets Groups Projects
Commit b6d33732 authored by Simon Oehrl's avatar Simon Oehrl
Browse files

Add optional database_host.txt file

parent 94612e73
No related branches found
No related tags found
No related merge requests found
Pipeline #163359 passed
...@@ -15,8 +15,11 @@ import numpy as np ...@@ -15,8 +15,11 @@ import numpy as np
def connect_to_database(): def connect_to_database():
database_host = 'database'
with open('database_host.txt') as database_host_file:
database_host = database_host_file.readline()
return psycopg2.connect(database="postgres", user="postgres", return psycopg2.connect(database="postgres", user="postgres",
password="postgres", host="database", port="5432") password="postgres", host=database_host, port="5432")
def arbor_get_attributes(): # noqa: E501 def arbor_get_attributes(): # noqa: E501
......
...@@ -15,8 +15,11 @@ import numpy as np ...@@ -15,8 +15,11 @@ import numpy as np
def connect_to_database(): def connect_to_database():
database_host = 'database'
with open('database_host.txt') as database_host_file:
database_host = database_host_file.readline()
return psycopg2.connect(database="postgres", user="postgres", return psycopg2.connect(database="postgres", user="postgres",
password="postgres", host="database", port="5432") password="postgres", host=database_host, port="5432")
def nest_get_gids(): # noqa: E501 def nest_get_gids(): # noqa: E501
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment