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 <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
