diff --git a/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java b/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java index 4e0b2fe782f..f0a109d5023 100644 --- a/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java +++ b/server/src/com/cloud/api/commands/UploadCustomCertificateCmd.java @@ -56,7 +56,7 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd { @Override public String getEventDescription() { - return ("Uploading custom certificate to the db, and applying it to the cpvm"); + return ("Uploading custom certificate to the db, and applying it to all the cpvms in the system"); } @Override diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java index 5438736f016..aa01af0cea1 100644 --- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java +++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java @@ -2493,7 +2493,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, VirtualMach //find corresponding host if(consoleProxy!=null){ HostVO consoleProxyHost = _hostDao.findConsoleProxyHost(consoleProxy.getName(), Type.ConsoleProxy); - //now send a command to console proxy + //now send a command to console proxy host UpdateCertificateCommand certCmd = new UpdateCertificateCommand(certStr, true); try { Answer updateCertAns = _agentMgr.send(consoleProxyHost.getId(), certCmd); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 21a7d6bda6f..cc35225299f 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -5876,7 +5876,7 @@ public class ManagementServerImpl implements ManagementServer { { Transaction.currentTxn(); Long certVOId = null; - CertificateVO cert = _certDao.listAll().get(0); //always 1 record in db + CertificateVO cert = _certDao.listAll().get(0); //always 1 record in db (from the deploydb time) if(cert.getMgmtServerId()!=null) throw new ResourceUnavailableException("Another management server is in the process of custom cert updating"); if(cert.getUpdated().equalsIgnoreCase("Y")){ @@ -5930,7 +5930,7 @@ public class ManagementServerImpl implements ManagementServer { for(ConsoleProxyVO cp : cpList) { Long cpHostId = hostNameToHostIdMap.get(cp.getName()); - //now send a command to each console proxy + //now send a command to each console proxy host UpdateCertificateCommand certCmd = new UpdateCertificateCommand(_certDao.findById(certVOId).getCertificate(), false); try { Answer updateCertAns = _agentMgr.send(cpHostId, certCmd); @@ -5971,7 +5971,7 @@ public class ManagementServerImpl implements ManagementServer { if(e instanceof ManagementServerException) throw new ServerApiException(BaseCmd.CUSTOM_CERT_UPDATE_ERROR, e.getMessage()); if(e instanceof IndexOutOfBoundsException){ - String msg = "Custom certificate record in the db deleted; this should never happen!"; + String msg = "Custom certificate record in the db deleted; this should never happen. Please create a new record in the certificate table"; s_logger.error(msg); throw new ServerApiException(BaseCmd.CUSTOM_CERT_UPDATE_ERROR, msg); } @@ -5980,14 +5980,14 @@ public class ManagementServerImpl implements ManagementServer { } private void releaseCertRecord(CertificateVO cert) throws ResourceUnavailableException { - CertificateVO lockedCertPostPatching = _certDao.acquire(cert.getId()); - if(lockedCertPostPatching == null){ + CertificateVO lockedCert = _certDao.acquire(cert.getId()); + if(lockedCert == null){ String msg = "Unable to obtain lock on the cert from releaseCertRecord() in uploadCertificate()"; s_logger.error(msg); }else{ try{ - lockedCertPostPatching.setMgmtServerId(null);//release for other ms - _certDao.update(lockedCertPostPatching.getId(), lockedCertPostPatching); + lockedCert.setMgmtServerId(null);//release for other ms + _certDao.update(lockedCert.getId(), lockedCert); }catch (Exception e){ s_logger.warn("Unable to update record in cert table from releaseCertRecord() during uploadCertificate()",e); }finally{