Skip to content

Commit fd182b8

Browse files
author
kishan
committed
Bug 13143: Use defaults for timezone when config is null or empty
Status 13143: resolved fixed Reviewed-By: Nitin
1 parent 1e38c28 commit fd182b8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

usage/src/com/cloud/usage/UsageManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
175175
m_sanityCheckInterval = Integer.parseInt(sanityCheckInterval);
176176
}
177177

178-
m_usageTimezone = TimeZone.getTimeZone(aggreagationTimeZone);
178+
if(aggreagationTimeZone != null && !aggreagationTimeZone.isEmpty()){
179+
m_usageTimezone = TimeZone.getTimeZone(aggreagationTimeZone);
180+
}
179181
s_logger.debug("Usage stats aggregation time zone: "+aggreagationTimeZone);
180182

181183
try {
@@ -196,7 +198,7 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
196198
m_jobExecTime.set(Calendar.MINUTE, minutes);
197199
m_jobExecTime.set(Calendar.SECOND, 0);
198200
m_jobExecTime.set(Calendar.MILLISECOND, 0);
199-
if(execTimeZone != null){
201+
if(execTimeZone != null && !execTimeZone.isEmpty()){
200202
m_jobExecTime.setTimeZone(TimeZone.getTimeZone(execTimeZone));
201203
}
202204

0 commit comments

Comments
 (0)