You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2021/12/15 12:06:50 UTC

[incubator-datalab] branch v.2.5.1-2629 created (now 6c8574f)

This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a change to branch v.2.5.1-2629
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.


      at 6c8574f  [DATALAB-2629]: fixed mongo commands for new pymongo version

This branch includes the following new commits:

     new 6c8574f  [DATALAB-2629]: fixed mongo commands for new pymongo version

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org


[incubator-datalab] 01/01: [DATALAB-2629]: fixed mongo commands for new pymongo version

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch v.2.5.1-2629
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 6c8574fa41c9527eb55a8d5405ebd741e3b54a1f
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Dec 2 16:22:58 2021 +0200

    [DATALAB-2629]: fixed mongo commands for new pymongo version
---
 infrastructure-provisioning/src/ssn/scripts/configure_mongo.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_mongo.py b/infrastructure-provisioning/src/ssn/scripts/configure_mongo.py
index 9b02cb0..d38acc4 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_mongo.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_mongo.py
@@ -72,8 +72,8 @@ def read_yml_conf(path, section, param):
 
 if __name__ == "__main__":
     mongo_passwd = "PASSWORD"
-    mongo_ip = read_yml_conf(path,'net','bindIp')
-    mongo_port = read_yml_conf(path,'net','port')
+    mongo_ip = read_yml_conf(path, 'net', 'bindIp')
+    mongo_port = read_yml_conf(path, 'net', 'port')
     #mongo_parameters = json.loads(args.mongo_parameters)
     # Setting up admin's password and enabling security
     client = MongoClient(mongo_ip + ':' + str(mongo_port))
@@ -82,7 +82,7 @@ if __name__ == "__main__":
         command = ['service', 'mongod', 'start']
         subprocess.call(command, shell=False)
         time.sleep(5)
-        client.datalabdb.add_user('admin', mongo_passwd, roles=[{'role': 'userAdminAnyDatabase', 'db': 'admin'}])
+        client.datalabdb.command('createUser', 'admin', pwd=mongo_passwd, roles=[{'role': 'userAdminAnyDatabase', 'db': 'admin'}])
         client.datalabdb.command('grantRolesToUser', "admin", roles=["readWrite"])
         # set_mongo_parameters(client, mongo_parameters)
         with open(args.datalab_path + 'tmp/local_endpoint.json', 'r') as data:

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org