X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=geni-config-tty;fp=geni-config-tty;h=85241703cd43f90018e366a3ab071c9478dc5dbf;hb=3a09ef62da97759bdf36748b1b125eb37932936d;hp=dae6c6a77fea485f93cd7cb4db7c6690c247b138;hpb=4254f524df48f07f324239d9363b1709a63828be;p=sfa.git diff --git a/geni-config-tty b/geni-config-tty index dae6c6a7..85241703 100755 --- a/geni-config-tty +++ b/geni-config-tty @@ -102,11 +102,12 @@ def save_config(changes, config_file): print 'updated config file',config_file def validate(changes): - defaults = get_defaults() - + if not changes: return {} + defaults = get_defaults() + # GENI_INTERFACE_HRN is GENI_REGISTRY_LEVEL1_AUTH, if thats blank it # then defaults to GENI_REGISTRY_ROOT_AUTH # GENI_REGISTRY_LEVEL1_AUTH, so if either of these are present we must @@ -167,7 +168,7 @@ def prompt_variable(variable, default_config): raise Exception ('BailOut') except KeyboardInterrupt: print "\n" - raise Excception ('BailOut') + raise Exception ('BailOut') if (answer == "") or (answer == default_value): return default_value @@ -262,8 +263,12 @@ def setup_server_key(config_dict): os.remove(fd) # create new server.key - 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() + 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 geni-config-tty for the first time (before gimport.py) + except: + print "Could not create %(old_server_key)s - ignore if you haven't run gimport yet"%locals()