コード例 #1
0
 def test_credential_update(self):
     cred11 = self._cred_test_obj(1, 1)
     cred11_id = cdb.add_credential(
         cred11.cname, cred11.usr, cred11.pwd, cred11.ctype).credential_id
     cdb.update_credential(cred11_id)
     new_usr = "******"
     new_pwd = "new password"
     new_credential = cdb.update_credential(
         cred11_id, new_usr, new_pwd)
     expected_cred = self.CredObj(
         cred11.cname, new_usr, new_pwd, cred11.ctype)
     self._assert_equal(new_credential, expected_cred)
     new_credential = cdb.get_credential(cred11_id)
     self._assert_equal(new_credential, expected_cred)
     with testtools.ExpectedException(c_exc.CredentialNotFound):
         cdb.update_credential(
             "dummyCredentialId", new_usr, new_pwd)
コード例 #2
0
ファイル: network_plugin.py プロジェクト: Karbit/neutron
 def rename_credential(self, credential_id, new_name):
     """Rename the particular credential resource."""
     LOG.debug(_("rename_credential() called"))
     try:
         credential = cdb.get_credential(credential_id)
     except exc.NotFound:
         raise cexc.CredentialNotFound(credential_id=credential_id)
     credential = cdb.update_credential(credential_id, new_name)
     return credential
コード例 #3
0
ファイル: network_plugin.py プロジェクト: Akanksha08/neutron
 def rename_credential(self, credential_id, new_name, new_password):
     """Rename the particular credential resource."""
     LOG.debug("rename_credential() called")
     return cdb.update_credential(credential_id, new_name,
                                  new_password=new_password)