mirror of https://github.com/apache/cloudstack.git
more cpvm refactoring
This commit is contained in:
parent
b08037d22c
commit
4d2e126ea1
|
|
@ -109,14 +109,13 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
|
|||
|
||||
protected Answer execute(final UpdateCertificateCommand cmd) {
|
||||
boolean success = false;
|
||||
try{
|
||||
try
|
||||
{
|
||||
String certificate = cmd.getCertificate();
|
||||
|
||||
//write the cert to /etc/cloud/consoleproxy/cert/
|
||||
boolean dirCreated = false;
|
||||
String strDirectoy = "/etc/cloud/consoleproxy/cert/";
|
||||
dirCreated = (new File(strDirectoy)).mkdirs();
|
||||
|
||||
if (dirCreated)
|
||||
{
|
||||
if(s_logger.isDebugEnabled())
|
||||
|
|
@ -128,13 +127,13 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
|
|||
//Close the output stream
|
||||
out.close();
|
||||
success = true;
|
||||
}
|
||||
return new Answer(cmd, success, "Custom certificate update required status");
|
||||
}
|
||||
}catch (Exception e)
|
||||
{
|
||||
s_logger.error("Unable to read the cert string in console proxy resource",e);
|
||||
success = false;
|
||||
}
|
||||
|
||||
return new Answer(cmd, success, "Custom certificate response from the updatecertificate flow");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5880,11 +5880,9 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
//certficate uploaded to db successfully
|
||||
//get a list of all Console proxies from the cp table
|
||||
List<ConsoleProxyVO> cpList = _consoleProxyDao.listAll();
|
||||
|
||||
for(ConsoleProxyVO cp : cpList)
|
||||
{
|
||||
HostVO cpHost = _hostDao.findConsoleProxyHost(cp.getName(), com.cloud.host.Host.Type.ConsoleProxy);
|
||||
|
||||
//now send a command to each console proxy
|
||||
UpdateCertificateCommand certCmd = new UpdateCertificateCommand(_certDao.findById(certVOId).getCertificate());
|
||||
try {
|
||||
|
|
@ -5900,10 +5898,8 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
s_logger.warn("Unable to send update certificate command to the console proxy resource", e);
|
||||
} catch (OperationTimedoutException e) {
|
||||
s_logger.warn("Unable to send update certificate command to the console proxy resource", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue