You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/09/27 06:58:04 UTC
[29/33] git commit: CLOUDSTACK-204 Setting global config
'consoleproxy.service.offering' causes mgmt failed to start (add exception
handling)
CLOUDSTACK-204 Setting global config 'consoleproxy.service.offering' causes mgmt failed to start (add exception handling)
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e5c0206d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e5c0206d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e5c0206d
Branch: refs/heads/4.0
Commit: e5c0206d986a2eef94f04e0f06cdf56038f2e160
Parents: 3b1fece
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Wed Sep 26 14:51:17 2012 +0800
Committer: Edison Su <di...@gmail.com>
Committed: Wed Sep 26 21:32:41 2012 -0700
----------------------------------------------------------------------
.../consoleproxy/ConsoleProxyManagerImpl.java | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e5c0206d/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 381b67c..a7f1c83 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -1518,16 +1518,19 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
String cpvmSrvcOffIdStr = configs.get(Config.ConsoleProxyServiceOffering.key());
if (cpvmSrvcOffIdStr != null) {
- Long cpvmSrvcOffId = _identityDao.getIdentityId(DiskOfferingVO.class.getAnnotation(Table.class).name(),cpvmSrvcOffIdStr);
- if(cpvmSrvcOffId != null)
+ Long cpvmSrvcOffId = null;
+ try {
+ cpvmSrvcOffId = _identityDao.getIdentityId(DiskOfferingVO.class.getAnnotation(Table.class).name(),cpvmSrvcOffIdStr);
+ } catch (Exception e) {
+ String msg = "Can't find system service offering specified by global config, uuid=" + cpvmSrvcOffIdStr + " for console proxy vm";
+ s_logger.warn(msg);
+ }
+ if(cpvmSrvcOffId != null){
_serviceOffering = _offeringDao.findById(cpvmSrvcOffId);
- if (_serviceOffering == null || !_serviceOffering.getSystemUse()) {
- String msg = "Can't find system service offering specified by global config, id=" + cpvmSrvcOffId + " for console proxy vm";
- s_logger.error(msg);
}
}
- if(_serviceOffering == null){
+ if(_serviceOffering == null || !_serviceOffering.getSystemUse()){
int ramSize = NumbersUtil.parseInt(_configDao.getValue("console.ram.size"), DEFAULT_PROXY_VM_RAMSIZE);
int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("console.cpu.mhz"), DEFAULT_PROXY_VM_CPUMHZ);
_serviceOffering = new ServiceOfferingVO("System Offering For Console Proxy", 1, ramSize, cpuFreq, 0, 0, false, null, useLocalStorage, true, null, true, VirtualMachine.Type.ConsoleProxy, true);