From 5559d1d8ef7dc0b42fb386d57c33d8da07bc9693 Mon Sep 17 00:00:00 2001 From: julius Date: Fri, 1 Oct 2021 11:39:16 -0700 Subject: [PATCH 1/3] remove close from mod_wsgi --- test/mod_wsgi_test/mod_wsgi_test.wsgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mod_wsgi_test/mod_wsgi_test.wsgi b/test/mod_wsgi_test/mod_wsgi_test.wsgi index 1fa4e74350..67c8c6b804 100644 --- a/test/mod_wsgi_test/mod_wsgi_test.wsgi +++ b/test/mod_wsgi_test/mod_wsgi_test.wsgi @@ -41,7 +41,7 @@ ndocs = 20 collection.drop() collection.insert_many([{'i': i} for i in range(ndocs)]) -client.close() # Discard main thread's request socket. + try: from mod_wsgi import version as mod_wsgi_version From 5da78ecfddac865ab4be6c9746cd5aab8692e25f Mon Sep 17 00:00:00 2001 From: julius Date: Tue, 5 Oct 2021 12:49:38 -0700 Subject: [PATCH 2/3] shane fixes --- test/mod_wsgi_test/mod_wsgi_test.wsgi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/mod_wsgi_test/mod_wsgi_test.wsgi b/test/mod_wsgi_test/mod_wsgi_test.wsgi index 67c8c6b804..b89d07a35c 100644 --- a/test/mod_wsgi_test/mod_wsgi_test.wsgi +++ b/test/mod_wsgi_test/mod_wsgi_test.wsgi @@ -41,7 +41,9 @@ ndocs = 20 collection.drop() collection.insert_many([{'i': i} for i in range(ndocs)]) - +client.close() # Discard main thread's request socket. +client = MongoClient() +collection = client.test.test try: from mod_wsgi import version as mod_wsgi_version From 30beffb77f28fed8121c2e8b84dcc9fc50cc855d Mon Sep 17 00:00:00 2001 From: julius Date: Tue, 5 Oct 2021 16:34:06 -0700 Subject: [PATCH 3/3] remove replica set discovery code, because that is now done automatically --- test/mod_wsgi_test/mod_wsgi_test.wsgi | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/mod_wsgi_test/mod_wsgi_test.wsgi b/test/mod_wsgi_test/mod_wsgi_test.wsgi index b89d07a35c..bfd1c4bab0 100644 --- a/test/mod_wsgi_test/mod_wsgi_test.wsgi +++ b/test/mod_wsgi_test/mod_wsgi_test.wsgi @@ -29,16 +29,8 @@ from pymongo.hello import HelloCompat from pymongo.mongo_client import MongoClient client = MongoClient() - -# If the deployment is a replica set, connect to the whole set. -replica_set_name = client.admin.command(HelloCompat.LEGACY_CMD).get('setName') -if replica_set_name: - client = MongoClient(replicaSet=replica_set_name) - collection = client.test.test - ndocs = 20 - collection.drop() collection.insert_many([{'i': i} for i in range(ndocs)]) client.close() # Discard main thread's request socket.