Skip to content

Commit d930441

Browse files
author
Roland Hedberg
committed
Only import stuff if needed
1 parent 09e6bda commit d930441

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/saml2/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import shelve
2525

2626
from saml2.eptid import EptidShelve, Eptid
27-
from saml2.mongo_store import IdentMDB, SessionStorageMDB, EptidMDB
2827
from saml2.sdb import SessionStorage
2928
from saml2.schema import soapenv
3029

@@ -89,6 +88,7 @@ def choose_session_storage(self):
8988
else: # Should be tuple
9089
typ, data = _spec
9190
if typ.lower() == "mongodb":
91+
from saml2.mongo_store import SessionStorageMDB
9292
return SessionStorageMDB(database=data, collection="session")
9393

9494
raise NotImplementedError("No such storage type implemented")
@@ -121,6 +121,7 @@ def init_config(self, stype="idp"):
121121
elif typ == "dict": # in-memory dictionary
122122
idb = {}
123123
elif typ == "mongodb":
124+
from saml2.mongo_store import IdentMDB
124125
self.ident = IdentMDB(database=addr, collection="ident")
125126

126127
if typ == "mongodb":
@@ -143,6 +144,7 @@ def init_config(self, stype="idp"):
143144
if typ == "shelve":
144145
self.eptid = EptidShelve(secret, addr)
145146
elif typ == "mongodb":
147+
from saml2.mongo_store import EptidMDB
146148
self.eptid = EptidMDB(secret, database=addr,
147149
collection="eptid")
148150
else:

0 commit comments

Comments
 (0)