summaryrefslogtreecommitdiff
path: root/src/db.py
diff options
context:
space:
mode:
authorKristofer Hallin <kristofer@sunet.se>2021-11-26 14:22:25 +0100
committerKristofer Hallin <kristofer@sunet.se>2021-11-26 14:22:25 +0100
commite1fe3943dcbc60da8cae733a6e66d385a35d5ffa (patch)
treed726599e520682caf7186fc8bd8281d1df99349e /src/db.py
parent0454f0353605886a0a3218c23b39060a05c6221d (diff)
Pass -c to quickstart_test.sh and we will start CouchDB for you as well.
Diffstat (limited to 'src/db.py')
-rwxr-xr-xsrc/db.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/db.py b/src/db.py
index 143d0a5..012dfac 100755
--- a/src/db.py
+++ b/src/db.py
@@ -32,8 +32,13 @@ class DictDB():
' COUCHDB_USER and COUCHDB_PASSWORD must be set.')
sys.exit(-1)
+ if 'COUCHDB_PORT' in os.environ:
+ couchdb_port = os.environ['COUCHDB_PORT']
+ else:
+ couchdb_port = 5984
+
self.server = couch.client.Server(
- f"http://{self.username}:{self.password}@{self.hostname}:5984/")
+ f"http://{self.username}:{self.password}@{self.hostname}:{couchdb_port}/")
try:
self.couchdb = self.server.database(self.database)