summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saml2/mdstore.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py
index a1bccb72..120e4fc8 100644
--- a/src/saml2/mdstore.py
+++ b/src/saml2/mdstore.py
@@ -1111,11 +1111,14 @@ class MetadataStore(MetaData):
self.metadata[key] = _md
def reload(self, spec):
+ # Save the old set of metadata
old_metadata = self.metadata
self.metadata = {}
try:
+ # Reload the metadata based on the spec
self.imp(spec)
except Exception as e:
+ # Something went wrong, restore the previous metadata
self.metadata = old_metadata
raise e