You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/01/15 14:46:14 UTC
git commit: updated refs/heads/4.5 to 1889247
Repository: cloudstack
Updated Branches:
refs/heads/4.5 b99d950dd -> 188924751
CLOUDSTACK-7219: Fix NPE, log warning when config item is missing from scope
- Cherry picked from Daan's fix 63fbd16dd11388bd93cdbec4ea7fe6de37aa7fc5
- Added another check if configDepot returned null
- Removed developer prefill values
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/18892475
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/18892475
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/18892475
Branch: refs/heads/4.5
Commit: 188924751ed87a01541a094e03e958cd8d01653b
Parents: b99d950
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Oct 2 11:58:20 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Jan 15 19:13:40 2015 +0530
----------------------------------------------------------------------
developer/developer-prefill.sql | 16 ----------------
.../src/com/cloud/server/ManagementServerImpl.java | 15 ++++++++++++---
2 files changed, 12 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18892475/developer/developer-prefill.sql
----------------------------------------------------------------------
diff --git a/developer/developer-prefill.sql b/developer/developer-prefill.sql
index c2d4f43..89d9c7e 100644
--- a/developer/developer-prefill.sql
+++ b/developer/developer-prefill.sql
@@ -62,22 +62,6 @@ INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
VALUES ('Advanced', 'DEFAULT', 'management-server',
'expunge.interval', '60');
-INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
- VALUES ('Advanced', 'DEFAULT', 'management-server',
- 'cluster.cpu.allocated.capacity.disablethreshold', '0.95');
-
-INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
- VALUES ('Advanced', 'DEFAULT', 'management-server',
- 'cluster.memory.allocated.capacity.disablethreshold ', '0.95');
-
-INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
- VALUES ('Advanced', 'DEFAULT', 'management-server',
- 'pool.storage.allocated.capacity.disablethreshold ', '0.95');
-
-INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
- VALUES ('Advanced', 'DEFAULT', 'management-server',
- 'pool.storage.capacity.disablethreshold ', '0.95');
-
-- Add developer configuration entry; allows management server to be run as a user other than "cloud"
INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
VALUES ('Advanced', 'DEFAULT', 'management-server',
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18892475/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index deb2424..85ce413 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -1709,9 +1709,18 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
List<ConfigurationVO> configVOList = new ArrayList<ConfigurationVO>();
for (ConfigurationVO param : result.first()) {
ConfigurationVO configVo = _configDao.findByName(param.getName());
- configVo.setValue(_configDepot.get(param.getName()).valueIn(id).toString());
- configVOList.add(configVo);
- }
+ if (configVo != null) {
+ ConfigKey<?> key = _configDepot.get(param.getName());
+ if (key != null) {
+ configVo.setValue(key.valueIn(id).toString());
+ configVOList.add(configVo);
+ } else {
+ s_logger.warn("ConfigDepot could not find parameter " + param.getName() + " for scope " + scope);
+ }
+ } else {
+ s_logger.warn("Configuration item " + param.getName() + " not found in " + scope);
+ }
+ }
return new Pair<List<? extends Configuration>, Integer>(configVOList, configVOList.size());
}