From 326dac098af10c8fccb8fd3243792d6a9147597a Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sun, 20 Nov 2011 22:38:26 -0500 Subject: [PATCH] create_gid() type defaults to authority --- sfa/server/sfa-start.py | 2 +- sfa/trust/hierarchy.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sfa/server/sfa-start.py b/sfa/server/sfa-start.py index 8c1b1d53..da6eba47 100755 --- a/sfa/server/sfa-start.py +++ b/sfa/server/sfa-start.py @@ -186,7 +186,7 @@ def main(): # ge the server's key and cert hierarchy = Hierarchy() - auth_info = hierarchy.get_interface_auth_info() + auth_info = hierarchy.get_interface_auth_info() server_key_file = auth_info.get_privkey_filename() server_cert_file = auth_info.get_gid_filename() diff --git a/sfa/trust/hierarchy.py b/sfa/trust/hierarchy.py index 31519b4f..239240e2 100644 --- a/sfa/trust/hierarchy.py +++ b/sfa/trust/hierarchy.py @@ -165,7 +165,6 @@ class Hierarchy: parent_urn = hrn_to_urn(parent_hrn, 'authority') if (parent_hrn) and (not self.auth_exists(parent_urn)) and (create_parents): self.create_auth(parent_urn, create_parents) - (directory, gid_filename, privkey_filename, dbinfo_filename) = \ self.get_auth_filenames(hrn) @@ -200,7 +199,6 @@ class Hierarchy: """ if not hrn: hrn = self.config.SFA_INTERFACE_HRN - # make sure parent exists parent_hrn = get_authority(hrn) if not parent_hrn: @@ -258,13 +256,14 @@ class Hierarchy: def create_gid(self, xrn, uuid, pkey, CA=False): hrn, type = urn_to_hrn(xrn) + if not type: + type = 'authority' parent_hrn = get_authority(hrn) # Using hrn_to_urn() here to make sure the urn is in the right format # If xrn was a hrn instead of a urn, then the gid's urn will be # of type None urn = hrn_to_urn(hrn, type) gid = GID(subject=hrn, uuid=uuid, hrn=hrn, urn=urn) - # is this a CA cert if hrn == self.config.SFA_INTERFACE_HRN or not parent_hrn: # root or sub authority -- 2.47.0