summaryrefslogtreecommitdiff
path: root/nova/utils.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2019-02-14 14:16:14 +0000
committerStephen Finucane <sfinucan@redhat.com>2019-02-14 14:16:14 +0000
commitf3b7b972ddea69649cfa6c79cad5a4220a2588c7 (patch)
tree4ebd17832de617af19fac98466cc073ae217b40b /nova/utils.py
parent9cb825b0147af3b191ea2989e5187e4afdadcb15 (diff)
downloadnova-f3b7b972ddea69649cfa6c79cad5a4220a2588c7.tar.gz
Address nits from I9e30a24a4c0640f282f507d0a96640d3cdefe43c
Change-Id: I0315e85a05c9faced339c3dd1fbb747c1c803add Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 2571cf3239..1e4fb8e390 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -292,8 +292,6 @@ def last_completed_audit_period(unit=None, before=None):
rightnow = before
else:
rightnow = timeutils.utcnow()
- if unit not in ('month', 'day', 'year', 'hour'):
- raise ValueError(_('Time period must be hour, day, month or year'))
if unit == 'month':
if offset == 0:
offset = 1
@@ -343,7 +341,7 @@ def last_completed_audit_period(unit=None, before=None):
end = end - datetime.timedelta(days=1)
begin = end - datetime.timedelta(days=1)
- elif unit == 'hour':
+ else: # unit == 'hour'
end = rightnow.replace(minute=offset, second=0, microsecond=0)
if end >= rightnow:
end = end - datetime.timedelta(hours=1)