Skip to content

Commit 6e90788

Browse files
fix: saml2.Entity/reload_metadata: use self.entity_type instead of iterating over all types
As per review suggestion in #809
1 parent d50235c commit 6e90788

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/saml2/entity.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,10 @@ def reload_metadata(self, metadata_conf):
226226

227227
logger.debug("Applying new metadata to main config")
228228
( self.metadata, self.sec.metadata, self.config.metadata ) = [new_metadata]*3
229-
for typ in ["aa", "idp", "sp", "pdp", "aq"]:
230-
policy = getattr(self.config, "_%s_policy" % typ, None)
231-
if policy and policy.metadata_store:
232-
logger.debug("Applying new metadata to %s policy", typ)
233-
policy.metadata_store = self.metadata
229+
policy = getattr(self.config, "_%s_policy" % self.entity_type, None)
230+
if policy and policy.metadata_store:
231+
logger.debug("Applying new metadata to %s policy", self.entity_type)
232+
policy.metadata_store = self.metadata
234233

235234
logger.debug("Applying new metadata source_id")
236235
self.sourceid = self.metadata.construct_source_id()

0 commit comments

Comments
 (0)