mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Fix ssl param default value
This commit is contained in:
parent
550b9cb804
commit
58d80e9731
@ -16,7 +16,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def connect(backend=None, host=None, port=None, name=None, max_tries=None,
|
def connect(backend=None, host=None, port=None, name=None, max_tries=None,
|
||||||
connection_timeout=None, replicaset=None, ssl=False, login=None, password=None):
|
connection_timeout=None, replicaset=None, ssl=None, login=None, password=None):
|
||||||
"""Create a new connection to the database backend.
|
"""Create a new connection to the database backend.
|
||||||
|
|
||||||
All arguments default to the current configuration's values if not
|
All arguments default to the current configuration's values if not
|
||||||
@ -50,8 +50,7 @@ def connect(backend=None, host=None, port=None, name=None, max_tries=None,
|
|||||||
# to handle these these additional args. In case of RethinkDBConnection
|
# to handle these these additional args. In case of RethinkDBConnection
|
||||||
# it just does not do anything with it.
|
# it just does not do anything with it.
|
||||||
replicaset = replicaset or bigchaindb.config['database'].get('replicaset')
|
replicaset = replicaset or bigchaindb.config['database'].get('replicaset')
|
||||||
ssl = bigchaindb.config['database'].get('ssl') if bigchaindb.config['database'].get('ssl') is not None \
|
ssl = ssl if ssl is not None else bigchaindb.config['database'].get('ssl', False)
|
||||||
else ssl
|
|
||||||
login = login or bigchaindb.config['database'].get('login')
|
login = login or bigchaindb.config['database'].get('login')
|
||||||
password = password or bigchaindb.config['database'].get('password')
|
password = password or bigchaindb.config['database'].get('password')
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class MongoDBConnection(Connection):
|
class MongoDBConnection(Connection):
|
||||||
|
|
||||||
def __init__(self, replicaset=None, ssl=False, login=None, password=None, **kwargs):
|
def __init__(self, replicaset=None, ssl=None, login=None, password=None, **kwargs):
|
||||||
"""Create a new Connection instance.
|
"""Create a new Connection instance.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -28,8 +28,7 @@ class MongoDBConnection(Connection):
|
|||||||
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
self.replicaset = replicaset or bigchaindb.config['database']['replicaset']
|
self.replicaset = replicaset or bigchaindb.config['database']['replicaset']
|
||||||
self.ssl = bigchaindb.config['database'].get('ssl') if bigchaindb.config['database'].get('ssl') is not None \
|
self.ssl = ssl if ssl is not None else bigchaindb.config['database'].get('ssl', False)
|
||||||
else ssl
|
|
||||||
self.login = login or bigchaindb.config['database'].get('login')
|
self.login = login or bigchaindb.config['database'].get('login')
|
||||||
self.password = password or bigchaindb.config['database'].get('password')
|
self.password = password or bigchaindb.config['database'].get('password')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user