Commit 38ff0ac9 authored by Owen Min's avatar Owen Min Committed by Chromium LUCI CQ

Fix crash in policy template presubmit check

When a boolean policy has a undefined value in the 'items' attributions,
the error message uses undefined variables and causes crash.

Bug: 1165816
Change-Id: I4600d0d8ba51472e8d69035c368f462a7f645b0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2629430
Commit-Queue: Owen Min <zmin@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Auto-Submit: Owen Min <zmin@chromium.org>
Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843643}
parent bd3e997f
......@@ -633,7 +633,7 @@ class PolicyTemplateChecker(object):
self._Error(
('Policy %s of type main has an item with a value %s, value '
'must be one of %s') %
(policy.get('name'), name, required_names))
(policy.get('name'), value, required_values))
if not values_seen.issuperset(required_values):
self._Error(
......
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