forked from pool/python-pysaml2
- Add patch pymongo-4-support.patch:
* Support pymongo >= 4 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysaml2?expand=0&rev=63
This commit is contained in:
37
pymongo-4-support.patch
Normal file
37
pymongo-4-support.patch
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
From 32a3c24ae1292ad04065aaaee6324ab9441fad8e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Johan Lundberg <lundberg@sunet.se>
|
||||||
|
Date: Wed, 8 Dec 2021 15:10:27 +0100
|
||||||
|
Subject: [PATCH] MongoReplicaSetClient removed in pymongo>=4
|
||||||
|
|
||||||
|
from pymongo docs:
|
||||||
|
Since PyMongo 3.0, MongoReplicaSetClient has been identical to
|
||||||
|
pymongo.mongo_client.MongoClient. Applications can simply replace
|
||||||
|
MongoReplicaSetClient with pymongo.mongo_client.MongoClient and get the
|
||||||
|
same behavior.
|
||||||
|
---
|
||||||
|
src/saml2/mongo_store.py | 5 +----
|
||||||
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/saml2/mongo_store.py b/src/saml2/mongo_store.py
|
||||||
|
index 7df1b5655..d7f834d1b 100644
|
||||||
|
--- a/src/saml2/mongo_store.py
|
||||||
|
+++ b/src/saml2/mongo_store.py
|
||||||
|
@@ -2,8 +2,7 @@
|
||||||
|
from hashlib import sha1
|
||||||
|
import logging
|
||||||
|
|
||||||
|
-from pymongo import MongoClient
|
||||||
|
-from pymongo.mongo_replica_set_client import MongoReplicaSetClient
|
||||||
|
+from pymongo.mongo_client import MongoClient
|
||||||
|
import pymongo.uri_parser
|
||||||
|
import pymongo.errors
|
||||||
|
from saml2.saml import NAMEID_FORMAT_PERSISTENT
|
||||||
|
@@ -288,8 +287,6 @@ def _mdb_get_database(uri, **kwargs):
|
||||||
|
_conn = MongoClient()
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
- if "replicaset" in _parsed_uri["options"]:
|
||||||
|
- connection_factory = MongoReplicaSetClient
|
||||||
|
db_name = _parsed_uri.get("database", "pysaml2")
|
||||||
|
_conn = connection_factory(uri, **kwargs)
|
||||||
|
|
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 28 06:04:01 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch pymongo-4-support.patch:
|
||||||
|
* Support pymongo >= 4
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Apr 7 08:37:47 UTC 2022 - pgajdos@suse.com
|
Thu Apr 7 08:37:47 UTC 2022 - pgajdos@suse.com
|
||||||
|
|
||||||
|
@@ -26,6 +26,9 @@ Summary: Python implementation of SAML Version 2 to be used in a WSGI env
|
|||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/IdentityPython/pysaml2
|
URL: https://github.com/IdentityPython/pysaml2
|
||||||
Source: https://github.com/IdentityPython/pysaml2/archive/v%{version}.tar.gz
|
Source: https://github.com/IdentityPython/pysaml2/archive/v%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM closed PR, but provides context:
|
||||||
|
# gh#IdentityPython/pysaml2#843
|
||||||
|
Patch0: pymongo-4-support.patch
|
||||||
BuildRequires: %{python_module Paste}
|
BuildRequires: %{python_module Paste}
|
||||||
BuildRequires: %{python_module cryptography >= 1.4}
|
BuildRequires: %{python_module cryptography >= 1.4}
|
||||||
BuildRequires: %{python_module dbm}
|
BuildRequires: %{python_module dbm}
|
||||||
@@ -74,7 +77,7 @@ It contains all necessary pieces for building a
|
|||||||
SAML2 service provider or an identity provider.
|
SAML2 service provider or an identity provider.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{modname}-%{version}
|
%autosetup -p1 -n %{modname}-%{version}
|
||||||
|
|
||||||
# delete shebang of files not in executable path
|
# delete shebang of files not in executable path
|
||||||
find src/ -name '*.py' -print0 | xargs -0 sed -i '1s/#!.*$//'
|
find src/ -name '*.py' -print0 | xargs -0 sed -i '1s/#!.*$//'
|
||||||
|
Reference in New Issue
Block a user