move trusted_roots directory to /etc/geni
[sfa.git] / geni / util / trustedroot.py
index e957655..7f9f738 100644 (file)
@@ -1,17 +1,21 @@
 import os
 
 from gid import *
+from geni.util.config import Config
 
 class TrustedRootList():
-    def __init__(self, dir="./trusted_roots"):
+    def __init__(self, dir=None):
+        if not dir:
+            config = Config()
+            dir = config.config_path + os.sep + 'trusted_roots'
         self.basedir = dir
-
+        
         # create the directory to hold the files
         try:
-            os.makedirs(self.basedir)\r
-        # if the path already exists then pass\r
-        except OSError, (errno, strerr):\r
-            if errno == 17:\r
+            os.makedirs(self.basedir)
+        # if the path already exists then pass
+        except OSError, (errno, strerr):
+            if errno == 17:
                 pass
 
     def add_gid(self, gid):