Commit 0866e86f authored by qyearsley's avatar qyearsley Committed by Commit bot

Clamp legacy bisect param max_time_minutes to be in the range [1, 60].

BUG=569691

Review URL: https://codereview.chromium.org/1522233002

Cr-Commit-Position: refs/heads/master@{#367022}
parent 93e15dbc
......@@ -199,7 +199,8 @@ def _CreateBisectOptionsFromConfig(config):
opts_dict['truncate_percent'] = int(config['truncate_percent'])
if config['max_time_minutes']:
opts_dict['max_time_minutes'] = int(config['max_time_minutes'])
opts_dict['max_time_minutes'] = _Clamp(
int(config['max_time_minutes']), low=1, high=60)
if config.has_key('use_goma'):
opts_dict['use_goma'] = config['use_goma']
......@@ -242,6 +243,11 @@ def _CreateBisectOptionsFromConfig(config):
return bisect_perf_regression.BisectOptions.FromDict(opts_dict)
def _Clamp(n, low, high):
"""Clamps a value to a range."""
return min(high, max(low, n))
def _ParseCloudLinksFromOutput(output):
html_results_pattern = re.compile(
r'\s(?P<VALUES>http://storage.googleapis.com/' +
......
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