From fc44c5203e0513b463e8e4df58dfaf8dfa8be3f7 Mon Sep 17 00:00:00 2001 From: kishan Date: Thu, 31 May 2012 14:33:27 +0530 Subject: [PATCH] bug CS-15168: Use cagetory from DB instead of Config.java, set category to Hidden during upgrade if they are not already status CS-15168: resolved fixed reviewed-by: Nitin --- .../com/cloud/configuration/ConfigurationManagerImpl.java | 5 +++-- .../com/cloud/configuration/dao/ConfigurationDaoImpl.java | 5 +++-- server/src/com/cloud/server/ConfigurationServerImpl.java | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 83ea5b68758..86a047c407a 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -283,14 +283,15 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura // As it is so common for people to forget about configuring // management.network.cidr, - String mgtCidr = _configDao.getValue(Config.ManagementNetwork.key()); + ConfigurationVO mgmtNetwork = _configDao.findByName(Config.ManagementNetwork.key()); + String mgtCidr = mgmtNetwork.getValue(); if (mgtCidr == null || mgtCidr.trim().isEmpty()) { String[] localCidrs = NetUtils.getLocalCidrs(); if (localCidrs.length > 0) { s_logger.warn("Management network CIDR is not configured originally. Set it default to " + localCidrs[0]); _alertMgr.sendAlert(AlertManager.ALERT_TYPE_MANAGMENT_NODE, 0, new Long(0), "Management network CIDR is not configured originally. Set it default to " + localCidrs[0], ""); - _configDao.update(Config.ManagementNetwork.key(), Config.ManagementNetwork.getCategory(), localCidrs[0]); + _configDao.update(Config.ManagementNetwork.key(), mgmtNetwork.getCategory(), localCidrs[0]); } else { s_logger.warn("Management network CIDR is not properly configured and we are not able to find a default setting"); _alertMgr.sendAlert(AlertManager.ALERT_TYPE_MANAGMENT_NODE, 0, new Long(0), "Management network CIDR is not properly configured and we are not able to find a default setting", ""); diff --git a/server/src/com/cloud/configuration/dao/ConfigurationDaoImpl.java b/server/src/com/cloud/configuration/dao/ConfigurationDaoImpl.java index a34bfd39229..35e584c2c96 100644 --- a/server/src/com/cloud/configuration/dao/ConfigurationDaoImpl.java +++ b/server/src/com/cloud/configuration/dao/ConfigurationDaoImpl.java @@ -163,14 +163,15 @@ public class ConfigurationDaoImpl extends GenericDaoBase