Skip to content

Commit 3b8c6ef

Browse files
authored
Fixing db authentication error- update database.py
Related to this issue: https://groups.google.com/forum/#!topic/atomate/Q0ege6lPdqs I had the same error. When I passed the database name into authsource it seemed to fix this issue.
1 parent 3acdfc2 commit 3b8c6ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

atomate/utils/database.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def from_db_file(cls, db_file, admin=True):
128128
kwargs = {}
129129
if "authsource" in creds:
130130
kwargs["authsource"] = creds["authsource"]
131+
else:
132+
kwargs["authsource"] = creds["database"]
131133

132134
return cls(creds["host"], int(creds["port"]), creds["database"], creds["collection"],
133135
user, password, **kwargs)

0 commit comments

Comments
 (0)