Updated to work with the new schema modules
This commit is contained in:
@@ -45,7 +45,7 @@ def keep_updated(func, self, entity_id, *args, **kwargs):
|
|||||||
class MetaData(object):
|
class MetaData(object):
|
||||||
""" A class to manage metadata information """
|
""" A class to manage metadata information """
|
||||||
|
|
||||||
def __init__(self, xmlsec_binary=None, attrconv=None, log=None):
|
def __init__(self, xmlsec_binary=None, attrconv=None, log=None, extras=None):
|
||||||
self.log = log
|
self.log = log
|
||||||
self.xmlsec_binary = xmlsec_binary
|
self.xmlsec_binary = xmlsec_binary
|
||||||
self.attrconv = attrconv or []
|
self.attrconv = attrconv or []
|
||||||
@@ -393,20 +393,20 @@ class MetaData(object):
|
|||||||
name = ""
|
name = ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for org in self.entity[entity_id]["organization"]:
|
org = self.entity[entity_id]["organization"]
|
||||||
try:
|
try:
|
||||||
name = org.organization_display_name[0]
|
name = org.organization_display_name[0]
|
||||||
|
except IndexError:
|
||||||
|
try:
|
||||||
|
name = org.organization_name[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
try:
|
try:
|
||||||
name = org.organization_name[0]
|
name = org.organization_url[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
try:
|
pass
|
||||||
name = org.organization_url[0]
|
|
||||||
except IndexError:
|
if name:
|
||||||
pass
|
name = name.text
|
||||||
|
|
||||||
if name:
|
|
||||||
name = name.text
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -211,11 +211,11 @@ def cert_from_key_info(key_info):
|
|||||||
res = []
|
res = []
|
||||||
for x509_data in key_info.x509_data:
|
for x509_data in key_info.x509_data:
|
||||||
#print "X509Data",x509_data
|
#print "X509Data",x509_data
|
||||||
for x509_certificate in x509_data.x509_certificate:
|
x509_certificate = x509_data.x509_certificate
|
||||||
cert = x509_certificate.text.strip()
|
cert = x509_certificate.text.strip()
|
||||||
cert = "\n".join(split_len("".join([
|
cert = "\n".join(split_len("".join([
|
||||||
s.strip() for s in cert.split()]),64))
|
s.strip() for s in cert.split()]),64))
|
||||||
res.append(cert)
|
res.append(cert)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def cert_from_instance(instance):
|
def cert_from_instance(instance):
|
||||||
|
|||||||
Reference in New Issue
Block a user