Fix UsageEnd in CSV reports
This fixes the value of UsageEnd in CSV reports. Currently, it is always equal to the usage_start of the first processed dataframe + one collect period. It was an issue with the first condition of _get_usage_end(): given that _get_usage_start() was always called before _get_usage_end(), the condition was always true and cached_end was never updated. Change-Id: Ice8f3b291a2b1327b9b95e1974de1431a93fd29e Story: 2001414 Task: 6112
This commit is contained in:
parent
51d1dd4635
commit
6e470bc37b
@ -95,7 +95,8 @@ class CSVMapped(csv_base.BaseCSVBackend):
|
|||||||
"""Get the end usage of this period.
|
"""Get the end usage of this period.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self.cached_start == self.usage_start and self.cached_end_str:
|
if self.cached_start == self.usage_start and self.cached_end_str \
|
||||||
|
and self.cached_end > self.cached_start:
|
||||||
return self.cached_end_str
|
return self.cached_end_str
|
||||||
else:
|
else:
|
||||||
usage_end = self.usage_start_dt + datetime.timedelta(
|
usage_end = self.usage_start_dt + datetime.timedelta(
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
The value of the UsageEnd field in CSV reports has been fixed.
|
Loading…
Reference in New Issue
Block a user