Exemplo n.º 1
0
 def _update_credential(self, db_cred, new_user_name=None,
                        new_password=None):
     """Updates a credential with a new user name and password."""
     return network_db_v2.update_credential(db_cred.tenant_id,
                                            db_cred.credential_id,
                                            new_user_name,
                                            new_password)
Exemplo n.º 2
0
 def _update_credential(self,
                        db_cred,
                        new_user_name=None,
                        new_password=None):
     """Updates a credential with a new user name and password."""
     return network_db_v2.update_credential(db_cred.tenant_id,
                                            db_cred.credential_id,
                                            new_user_name, new_password)
Exemplo n.º 3
0
 def test_credential_update(self):
     """Tests update of a credential with a new user name and password."""
     cred11 = self._cred_test_obj(1, 1)
     cred11_db = self._add_credential(cred11)
     self._update_credential(cred11_db)
     new_user_name = "new user name"
     new_pwd = "new password"
     new_credential = self._update_credential(
         cred11_db, new_user_name, new_pwd)
     expected_cred = self.CredObj(
         cred11.tenant_id, cred11.cred_name, new_user_name, new_pwd)
     self._assert_cred_equal(new_credential, expected_cred)
     new_credential = self._get_credential(cred11_db)
     self._assert_cred_equal(new_credential, expected_cred)
     with testtools.ExpectedException(exceptions.CredentialNotFound):
         network_db_v2.update_credential(
             "dummyTenantId", "dummyCredentialId", new_user_name, new_pwd)
Exemplo n.º 4
0
 def test_credential_update(self):
     """Tests update of a credential with a new user name and password."""
     cred11 = self._cred_test_obj(1, 1)
     cred11_db = self._add_credential(cred11)
     self._update_credential(cred11_db)
     new_user_name = "new user name"
     new_pwd = "new password"
     new_credential = self._update_credential(cred11_db, new_user_name,
                                              new_pwd)
     expected_cred = self.CredObj(cred11.tenant_id, cred11.cred_name,
                                  new_user_name, new_pwd)
     self._assert_cred_equal(new_credential, expected_cred)
     new_credential = self._get_credential(cred11_db)
     self._assert_cred_equal(new_credential, expected_cred)
     with testtools.ExpectedException(exceptions.CredentialNotFound):
         network_db_v2.update_credential("dummyTenantId",
                                         "dummyCredentialId", new_user_name,
                                         new_pwd)