- don't depend on plc_config, make sfa-config self-contained.
[sfa.git] / config / sfa-config-tty
index 348b921..dc8355a 100755 (executable)
@@ -19,9 +19,9 @@ import traceback
 import distutils.file_util
 from optparse import OptionParser
 
-from geni.util.config import Config
-from geni.util.hierarchy import *
-from geni.util.misc import *
+from sfa.util.config import Config
+from sfa.trust.hierarchy import *
+from sfa.util.misc import *
 
 
 all_variables   = ["GENI_REGISTRY_ROOT_AUTH",
@@ -38,11 +38,19 @@ all_variables   = ["GENI_REGISTRY_ROOT_AUTH",
                    "GENI_PLC_USER",
                    "GENI_PLC_PASSWORD",    
                    "GENI_PLC_URL",
+                   "GENI_PLC_DB_NAME",
+                   "GENI_PLC_DB_HOST",
+                   "GENI_PLC_DB_PORT",
+                   "GENI_PLC_DB_USER",
+                   "GENI_PLC_DB_PASSWORD",
                    ]
 usual_variables = ["GENI_REGISTRY_ROOT_AUTH",
                    "GENI_REGISTRY_LEVEL1_AUTH",
                    "GENI_PLC_USER",
-                   "GENI_PLC_PASSWORD",    
+                   "GENI_PLC_PASSWORD",
+                   "GENI_PLC_API_HOST",
+                   "GENI_PLC_DB_USER",
+                   "GENI_PLC_DB_PASSWORD",
                    ]
 
 
@@ -129,14 +137,6 @@ def validate(changes):
 
 def get_defaults():
     sfa_config = Config()
-    plc_vars = {'PLC_API_MAINTENANCE_PASSWORD': 'GENI_PLC_PASSWORD',
-                'PLC_API_MAINTENANCE_USER': 'GENI_PLC_USER'
-               }
-    try:
-        from geni.util.config import plcConfig
-        plc_config = plcConfig
-    except:
-        plc_config = None
     
     defaults = {}
     for var in dir(sfa_config):
@@ -144,12 +144,6 @@ def get_defaults():
             value = eval("sfa_config.%s" % var)
             defaults[var] = value
 
-    # some defaults come from plc_config
-    for var in dir(plc_config):
-        if var in plc_vars:
-            value = eval("plc_config.%s" % var)
-            defaults[plc_vars[var]] = value
-
     return defaults       
 
 def prompt_variable(variable, default_config):
@@ -264,9 +258,9 @@ def setup_server_key(config_dict):
     try:
         distutils.file_util.copy_file(src=new_server_key, dst=old_server_key, verbose=1)
         print "\t\t%(old_server_key)s\ncopied from\t%(new_server_key)s" % locals()
-    # this is expected when running this tool for the first time (before gimport.py)
+    # this is expected when running this tool for the first time (before sfa-import-plc.py)
     except:
-        print "Could not create %(old_server_key)s - ignore if you haven't run gimport yet"%locals()
+        print "Could not create %(old_server_key)s - ignore if you haven't run sfa-import-plc.py yet"%locals()
     
     
 
@@ -277,7 +271,7 @@ def main ():
     argv = sys.argv[1:]
     save = True
     parser = OptionParser(usage=command_usage, version="%prog 1.0")
-    parser.set_defaults(config_dir="/etc/geni",
+    parser.set_defaults(config_dir="/etc/sfa",
                         usual_variables=[])
     parser.add_option("","--configdir",dest="config_dir",action="append", help="specify configuration directory")
     parser.add_option("","--usual_variable",dest="usual_variables",action="append", help="add a usual variable")