def ImportConfig(filename, config):
 sections_to_import = ['PrivateKeys']
 entries_to_import = ['Client.executable_signing_public_key', 'CA.certificate', 'Frontend.certificate']
 options_imported = 0
 old_config = config_lib.CONFIG.MakeNewConfig()
 old_config.Initialize(filename)
 for entry in old_config.raw_data.keys():
  try:
   section = entry.split('.')[0]
   if ((section in sections_to_import) or (entry in entries_to_import)):
    config.Set(entry, old_config.Get(entry))
    print ('Imported %s.' % entry)
    options_imported += 1
  except Exception as e:
   print ('Exception during import of %s: %s' % (entry, e))
 return options_imported

def ImportConfig ( filename , config ) : sections_to_import = [ 'PrivateKeys' ] entries_to_import = [ 'Client.executable_signing_public_key' , 'CA.certificate' , 'Frontend.certificate' ] options_imported = 0 old_config = config_lib . CONFIG . MakeNewConfig ( ) old_config . Initialize ( filename ) for entry in old_config . raw_data . keys ( ) : try : section = entry . split ( '.' ) [ 0 ] if ( ( section in sections_to_import ) or ( entry in entries_to_import ) ) : config . Set ( entry , old_config . Get ( entry ) ) print ( 'Imported %s.' % entry ) options_imported += 1 except Exception as e : print ( 'Exception during import of %s: %s' % ( entry , e ) ) return options_imported
reads an old config file and imports keys and user accounts .