Skip to content
Snippets Groups Projects
Commit b2f7a796 authored by Marco Malavolti's avatar Marco Malavolti
Browse files

Fixed a problem with IdP displayName with quotes

parent 412cba5d
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@ class EccsResults(Resource):
for line in lines:
# Strip the line feed and carriage return characters
line = line.rstrip("\n\r")
print(line)
# Loads the json line into aux
aux = json.loads(line)
......
......@@ -97,7 +97,7 @@ def checkIdP(sp,idp,test):
return (idp['entityID'],wayfless_url,check_time,"(failed)","Timeout")
except Exception as e:
print ("!!! EXCEPTION !!!")
print ("!!! EXCEPTION DRIVER !!!")
print (e.__str__())
print ("IdP: %s\nSP: %s" % (idp['entityID'],sp))
return None
......@@ -143,7 +143,7 @@ def checkIdP(sp,idp,test):
status_code = "333"
except Exception as e:
print ("!!! EXCEPTION !!!")
print ("!!! EXCEPTION REQUESTS !!!")
print (e.__str__())
print ("IdP: %s\nSP: %s" % (idp['entityID'],sp))
status_code = "555"
......@@ -161,10 +161,10 @@ def getDisplayName(display_name):
display_name_equal_splitted = display_name.split('==')
for elem in display_name_equal_splitted:
if "en" in elem:
if "'" in elem:
elem = elem.replace("'","'")
if "'" in elem:
elem = elem.replace("'","'")
elem = elem.replace("'","'")
if '"' in elem:
elem = elem.replace('"','\\"')
return elem.split(';')[1]
......
......@@ -50,7 +50,7 @@ def getListFeds(url, dest_file):
# then open it and work with local file
with open("%s" % (dest_file), mode="r", encoding='utf-8') as f:
return json.loads(f.read().replace("'", "'"))
return json.loads(f.read().replace("'","'"))
# Download all eduGAIN IdPs from URL, store them on a local file and returns a Python List
......@@ -63,7 +63,7 @@ def getListEccsIdps(url, dest_file):
# then open it and work with local file
with open("%s" % (dest_file), mode="r", encoding='utf-8') as f:
return json.loads(f.read().replace("'", "'"))
return json.loads(f.read().replace("'","'"))
# Use logger to produce files consumed by ECCS-2 API
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment