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",
"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",
]
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):
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):
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()