diff --git a/api.py b/api.py index c6b451e65c89357c0b574ff75db5200dae3a9be9..30a80002a7f58b1bb41654c83e80a19dd3a74690 100755 --- a/api.py +++ b/api.py @@ -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) diff --git a/eccs2.py b/eccs2.py index ad79537f348073f17188a6f96a4599447203cf7d..12c3b104810588102dcd08016a1b532ec04de430 100755 --- a/eccs2.py +++ b/eccs2.py @@ -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] diff --git a/utils.py b/utils.py index 44243551765908165f06ad91af1059e070b5a714..03604e96c688a9b1c39fddb775812518d0495541 100644 --- a/utils.py +++ b/utils.py @@ -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