From ccd3fb3d96ca3bd2f43def5e48816aa7c1ce5961 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 4 Mar 2009 17:17:40 +0000 Subject: [PATCH] no longer assume basedir is our current working dir, get basedir from config --- geni/util/hierarchy.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/geni/util/hierarchy.py b/geni/util/hierarchy.py index 5aa3bc9b..cbaa699b 100644 --- a/geni/util/hierarchy.py +++ b/geni/util/hierarchy.py @@ -103,7 +103,10 @@ class Hierarchy(): # # @param basedir the base directory to store the hierarchy in - def __init__(self, basedir="."): + def __init__(self, basedir = None): + config = Config() + if not basedir: + basedir = config.GENI_BASE_DIR + os.sep + 'geni' + os.sep self.basedir = os.path.join(basedir, "authorities") ## @@ -132,7 +135,7 @@ class Hierarchy(): def auth_exists(self, hrn): (directory, gid_filename, privkey_filename, dbinfo_filename) = \ self.get_auth_filenames(hrn) - + return os.path.exists(gid_filename) and \ os.path.exists(privkey_filename) and \ os.path.exists(dbinfo_filename) @@ -185,7 +188,7 @@ class Hierarchy(): def get_auth_info(self, hrn): #report.trace("Hierarchy: getting authority: " + hrn) - + if not self.auth_exists(hrn): raise MissingAuthority(hrn) -- 2.43.0