From 4487b6d184a2f39f1dc6112ed3092221ad0abede Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Tue, 30 Jun 2015 20:50:45 -0700 Subject: [PATCH] Fix errors with fetching Shibboleth metadata --- common/djangoapps/third_party_auth/tasks.py | 4 ++-- .../third_party_auth/tests/data/testshib_metadata.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/djangoapps/third_party_auth/tasks.py b/common/djangoapps/third_party_auth/tasks.py index 7466e113af..16daf4eb80 100644 --- a/common/djangoapps/third_party_auth/tasks.py +++ b/common/djangoapps/third_party_auth/tasks.py @@ -63,7 +63,7 @@ def fetch_saml_metadata(): try: parser = etree.XMLParser(remove_comments=True) - xml = etree.fromstring(response.text, parser) + xml = etree.fromstring(response.content, parser) except etree.XMLSyntaxError: raise # TODO: Can use OneLogin_Saml2_Utils to validate signed XML if anyone is using that @@ -80,7 +80,7 @@ def fetch_saml_metadata(): except Exception as err: # pylint: disable=broad-except log.exception(err.message) num_failed += 1 - return (num_changed, num_failed, len(url_map)) + return (num_changed, num_failed, len(url_map)) def _parse_metadata_xml(xml, entity_id): diff --git a/common/djangoapps/third_party_auth/tests/data/testshib_metadata.xml b/common/djangoapps/third_party_auth/tests/data/testshib_metadata.xml index e78b2e1733..cf74a5ad59 100644 --- a/common/djangoapps/third_party_auth/tests/data/testshib_metadata.xml +++ b/common/djangoapps/third_party_auth/tests/data/testshib_metadata.xml @@ -1,3 +1,4 @@ +