Ejemplo n.º 1
0
 def set_credential(self, username, cloud, credential):
     """credential is a dict"""
     safe_credential = {}
     for cred in credential:
         safe_credential[cred] = encrypt(credential[cred], self.password_key)
     self.userdb_passwd.update({"cm_user_id": username, "cloud": cloud }, \
                               {"cm_user_id":username, "credential":safe_credential, \
                                "cloud": cloud}, upsert=True)
Ejemplo n.º 2
0
 def set_credential(self, username, cloud, credential, cred_type='cloud'):
     """credential is a dict"""
     safe_credential = {}
     if cred_type in ('cloud', 'cm_password_local'):
         for cred in credential:
             safe_credential[cred] = encrypt(
                 credential[cred], self.password_key)
         self.userdb_passwd.update({"cm_user_id": username, "%s" % cred_type: cloud},
                                   {"cm_user_id": username, "credential": safe_credential,
                                    "%s" % cred_type: cloud}, upsert=True)
Ejemplo n.º 3
0
 def set_credential(self, username, cloud, credential, cred_type='cloud'):
     """credential is a dict"""
     safe_credential = {}
     if cred_type in ('cloud', 'cm_password_local'):
         for cred in credential:
             safe_credential[cred] = encrypt(credential[cred],
                                             self.password_key)
         self.userdb_passwd.update(
             {
                 "cm_user_id": username,
                 "%s" % cred_type: cloud
             }, {
                 "cm_user_id": username,
                 "credential": safe_credential,
                 "%s" % cred_type: cloud
             },
             upsert=True)