From: Tony Mack Date: Tue, 5 Feb 2013 01:00:27 +0000 (-0500) Subject: refactored X-Git-Tag: sfa-3.0-0~5 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=3d0e82ae791b91dc8aea671c0d9c3613febf8e68 refactored --- diff --git a/sfa/trust/certificate.py b/sfa/trust/certificate.py index 015556e1..59ec4427 100644 --- a/sfa/trust/certificate.py +++ b/sfa/trust/certificate.py @@ -318,7 +318,7 @@ class Certificate: # @param filename If filename!=None, load the certficiate from the file. # @param isCA If !=None, set whether this cert is for a CA - def __init__(self, lifeDays=1825, create=False, subject=None, string=None, filename=None, isCA=None, email=None): + def __init__(self, lifeDays=1825, create=False, subject=None, string=None, filename=None, isCA=None): self.data = {} if create or subject: self.create(lifeDays) @@ -328,8 +328,6 @@ class Certificate: self.load_from_string(string) if filename: self.load_from_file(filename) - if email: - self.set_email(email) # Set the CA bit if a value was supplied if isCA != None: diff --git a/sfa/trust/gid.py b/sfa/trust/gid.py index 96d375e7..f4c0cb13 100644 --- a/sfa/trust/gid.py +++ b/sfa/trust/gid.py @@ -66,11 +66,6 @@ def create_uuid(): class GID(Certificate): - uuid = None - hrn = None - urn = None - email = None # for adding to the SubjectAltName - ## # Create a new GID object # @@ -81,7 +76,10 @@ class GID(Certificate): # @param lifeDays life of GID in days - default is 1825==5 years def __init__(self, create=False, subject=None, string=None, filename=None, uuid=None, hrn=None, urn=None, lifeDays=1825, email=None): - + self.uuid = None + self.hrn = None + self.urn = None + self.email = None # for adding to the SubjectAltName Certificate.__init__(self, lifeDays, create, subject, string, filename, email=email) if subject: logger.debug("Creating GID for subject: %s" % subject) @@ -93,6 +91,8 @@ class GID(Certificate): if urn: self.urn = urn self.hrn, type = urn_to_hrn(urn) + if email: + self.set_email(email) def set_uuid(self, uuid): if isinstance(uuid, str):