Updated Branches:
  refs/heads/master b896bdb7e -> 2da5b448a

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/2da5b448
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/2da5b448
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/2da5b448

Branch: refs/heads/master
Commit: 2da5b448a1e5024dda6d24aa68a1f08b1734ae52
Parents: b896bdb
Author: Mice Xia <[email protected]>
Authored: Wed Sep 26 14:51:17 2012 +0800
Committer: Mice Xia <[email protected]>
Committed: Wed Sep 26 14:51:17 2012 +0800

----------------------------------------------------------------------
 .../consoleproxy/ConsoleProxyManagerImpl.java      |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2da5b448/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);

Reply via email to