|
@@ -1,3 +1,5 @@
|
|
1
|
+from .utils import connect, get_connection_args
|
|
2
|
+
|
1
|
3
|
__loader__ = "main.py"
|
2
|
4
|
__confspec__ = "confspec.py"
|
3
|
5
|
__author__ = "Lodel2 dev team"
|
|
@@ -10,4 +12,13 @@ __fullname__ = "MongoDB plugin"
|
10
|
12
|
#
|
11
|
13
|
# @return bool|str : True if all the checks are OK, an error message if not
|
12
|
14
|
def _activate():
|
|
15
|
+ default_connection_args = get_connection_args()
|
|
16
|
+ connection_check = connect(
|
|
17
|
+ default_connection_args['host'],
|
|
18
|
+ default_connection_args['port'],
|
|
19
|
+ default_connection_args['db_name'],
|
|
20
|
+ default_connection_args['username'],
|
|
21
|
+ default_connection_args['password'])
|
|
22
|
+ if not connection_check:
|
|
23
|
+ return False
|
13
|
24
|
return True
|