Commit 8ad971db authored by Brian White's avatar Brian White Committed by Commit Bot

Support 'never' as expiry date.

Bug: 923083
Change-Id: I25136857b84832ac896e76f32c182af8eb190e15
Reviewed-on: https://chromium-review.googlesource.com/c/1418517Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Brian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625353}
parent 88574aa1
......@@ -303,14 +303,14 @@ def _ExtractHistogramsFromXmlTree(tree, enums):
# Handle expiry attribute.
if histogram.hasAttribute('expires_after'):
expiry_str = histogram.getAttribute('expires_after')
if _ValidateMilestoneString(expiry_str) or _ValidateDateString(
expiry_str):
if (expiry_str == "never" or _ValidateMilestoneString(expiry_str) or
_ValidateDateString(expiry_str)):
histogram_entry['expires_after'] = expiry_str
else:
logging.error(
'Expiry of histogram %s does not match expected date format: "%s"'
' or milestone format: M* found %s.', name, EXPIRY_DATE_PATTERN,
expiry_str)
'Expiry of histogram %s does not match expected date format ("%s"),'
' milestone format (M*), or "never": found %s.', name,
EXPIRY_DATE_PATTERN, expiry_str)
have_errors = True
# Find <owner> tag.
......
......@@ -67,6 +67,8 @@ def _GetExpiredHistograms(histograms, base_date, current_milestone):
if "obsolete" in content or "expires_after" not in content:
continue
expiry_str = content["expires_after"]
if expiry_str == "never":
continue
match = _MILESTONE_EXPIRY_RE.search(expiry_str)
if match:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment