mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-1624: Initialize configuration variables properly to avoid influence of any racing conditions
This commit is contained in:
parent
8a99fb348f
commit
85198980ca
|
|
@ -252,17 +252,19 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
// FIXME - why don't we have interface for DataCenterLinkLocalIpAddressDao?
|
||||
@Inject protected DataCenterLinkLocalIpAddressDao _LinkLocalIpAllocDao;
|
||||
|
||||
private int _maxVolumeSizeInGb;
|
||||
private long _defaultPageSize;
|
||||
private int _maxVolumeSizeInGb = Integer.parseInt(Config.MaxVolumeSize.getDefaultValue());
|
||||
private long _defaultPageSize = Long.parseLong(Config.DefaultPageSize.getDefaultValue());
|
||||
protected Set<String> configValuesForValidation;
|
||||
|
||||
@Override
|
||||
public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
|
||||
String maxVolumeSizeInGbString = _configDao.getValue("storage.max.volume.size");
|
||||
_maxVolumeSizeInGb = NumbersUtil.parseInt(maxVolumeSizeInGbString, 2000);
|
||||
String maxVolumeSizeInGbString = _configDao.getValue(Config.MaxVolumeSize.key());
|
||||
_maxVolumeSizeInGb = NumbersUtil.parseInt(maxVolumeSizeInGbString,
|
||||
Integer.parseInt(Config.MaxVolumeSize.getDefaultValue()));
|
||||
|
||||
String defaultPageSizeString = _configDao.getValue("default.page.size");
|
||||
_defaultPageSize = NumbersUtil.parseLong(defaultPageSizeString, 500L);
|
||||
String defaultPageSizeString = _configDao.getValue(Config.DefaultPageSize.key());
|
||||
_defaultPageSize = NumbersUtil.parseLong(defaultPageSizeString,
|
||||
Long.parseLong(Config.DefaultPageSize.getDefaultValue()));
|
||||
|
||||
populateConfigValuesForValidationSet();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue