Merge "Address nits from I9e30a24a4c0640f282f507d0a96640d3cdefe43c"
This commit is contained in:
commit
af78b13c24
|
@ -24,7 +24,7 @@ cinder_group = cfg.OptGroup(
|
|||
cinder_opts = [
|
||||
cfg.StrOpt('catalog_info',
|
||||
default='volumev3::publicURL',
|
||||
regex='^(\w+):(\w*):(.*?)$',
|
||||
regex=r'^\w+:\w*:.*$',
|
||||
help="""
|
||||
Info to match when looking for cinder in the service catalog.
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ This service is typically executed on the controller node.
|
|||
"""),
|
||||
cfg.StrOpt('port_range',
|
||||
default=DEFAULT_PORT_RANGE,
|
||||
regex="^\d+:\d+$",
|
||||
regex=r'^\d+:\d+$',
|
||||
help="""
|
||||
A range of TCP ports a guest can use for its backend.
|
||||
|
||||
|
|
|
@ -293,8 +293,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
|
||||
|
@ -344,7 +342,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)
|
||||
|
|
Loading…
Reference in New Issue