def _EncryptSecrets(io_loop):
 print 'Initializing existing secrets manager...'
 ex_sm = _GetSecretsManager()
 print 'Initializing new secrets manager...'
 if options.options.shared:
  new_sm = secrets.SecretsManager('shared', options.options.domain, options.options.secrets_dir)
 else:
  new_sm = secrets.SecretsManager('user', options.options.domain, options.options.user_secrets_dir)
 new_sm.Init(should_prompt=True, query_twice=True)
 print 'Encrypting secrets...'
 for secret in ex_sm.ListSecrets():
  print ('  %s' % secret)
  new_sm.PutSecret(secret, ex_sm.GetSecret(secret))
 io_loop.stop()

def _EncryptSecrets ( io_loop ) : print 'Initializing existing secrets manager...' ex_sm = _GetSecretsManager ( ) print 'Initializing new secrets manager...' if options . options . shared : new_sm = secrets . SecretsManager ( 'shared' , options . options . domain , options . options . secrets_dir ) else : new_sm = secrets . SecretsManager ( 'user' , options . options . domain , options . options . user_secrets_dir ) new_sm . Init ( should_prompt = True , query_twice = True ) print 'Encrypting secrets...' for secret in ex_sm . ListSecrets ( ) : print ( '  %s' % secret ) new_sm . PutSecret ( secret , ex_sm . GetSecret ( secret ) ) io_loop . stop ( )
lists all secrets files and encrypts each in turn .