mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Formatting
This commit is contained in:
parent
8526246f78
commit
3b1e6adb43
@ -75,16 +75,17 @@ class MongoDBConnection(Connection):
|
|||||||
# we should only return a connection if the replica set is
|
# we should only return a connection if the replica set is
|
||||||
# initialized. initialize_replica_set will check if the
|
# initialized. initialize_replica_set will check if the
|
||||||
# replica set is initialized else it will initialize it.
|
# replica set is initialized else it will initialize it.
|
||||||
initialize_replica_set(self.host, self.port, self.connection_timeout, self.dbname, self.ssl, self.login, self.password)
|
initialize_replica_set(self.host, self.port, self.connection_timeout,
|
||||||
|
self.dbname, self.ssl, self.login, self.password)
|
||||||
|
|
||||||
# FYI: this might raise a `ServerSelectionTimeoutError`,
|
# FYI: this might raise a `ServerSelectionTimeoutError`,
|
||||||
# that is a subclass of `ConnectionFailure`.
|
# that is a subclass of `ConnectionFailure`.
|
||||||
client = pymongo.MongoClient(self.host,
|
client = pymongo.MongoClient(self.host,
|
||||||
self.port,
|
self.port,
|
||||||
replicaset=self.replicaset,
|
replicaset=self.replicaset,
|
||||||
serverselectiontimeoutms=self.connection_timeout,
|
serverselectiontimeoutms=self.connection_timeout,
|
||||||
ssl=self.ssl)
|
ssl=self.ssl)
|
||||||
|
|
||||||
if self.login is not None and self.password is not None:
|
if self.login is not None and self.password is not None:
|
||||||
client[self.dbname].authenticate(self.login, self.password)
|
client[self.dbname].authenticate(self.login, self.password)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user