Skip to content

Commit 5d389b1

Browse files
Harikrishna Patnalakaruturi
authored andcommitted
CLOUDSTACK-5992: default values of configuraiton parameters in configuration table are set NULL on fresh setup Some configuration parameters have Component names different from fresh and upgrade setup
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
1 parent ffbcd29 commit 5d389b1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,14 @@ private void createOrupdateConfigObject(Date date, String componentName, ConfigK
136136
}
137137
_configDao.persist(vo);
138138
} else {
139-
if (vo.isDynamic() != key.isDynamic() || !ObjectUtils.equals(vo.getDescription(), key.description()) || !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())
140-
|| !ObjectUtils.equals(vo.getScope(), key.scope().toString())) {
139+
if (vo.isDynamic() != key.isDynamic() || !ObjectUtils.equals(vo.getDescription(), key.description()) || !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue()) ||
140+
!ObjectUtils.equals(vo.getScope(), key.scope().toString()) ||
141+
!ObjectUtils.equals(vo.getComponent(), componentName)) {
141142
vo.setDynamic(key.isDynamic());
142143
vo.setDescription(key.description());
143144
vo.setDefaultValue(key.defaultValue());
144145
vo.setScope(key.scope().toString());
146+
vo.setComponent(componentName);
145147
vo.setUpdated(date);
146148
_configDao.persist(vo);
147149
}

server/src/com/cloud/server/ConfigurationServerImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ public void persistDefaultValues() throws InternalErrorException {
206206
value = ("Hidden".equals(category) || "Secure".equals(category)) ? DBEncryptionUtil.encrypt(value) : value;
207207
String description = c.getDescription();
208208
ConfigurationVO configVO = new ConfigurationVO(category, instance, component, name, value, description);
209+
configVO.setDefaultValue(value);
209210
_configDao.persist(configVO);
210211
}
211212
}

0 commit comments

Comments
 (0)