Commit 7b30e750 authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

Allow None value for default value check in policy presubmit

Previously, the check failed if the default value was set to None
explicitly. This CL changes the check to fail only if the default value
is not set.

Change-Id: I2eb179f306e340b73e24a08f9bfe63bc07706b3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533288
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: default avatarChris Sharp <csharp@chromium.org>
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826742}
parent f3e16d1e
......@@ -1552,8 +1552,7 @@ class PolicyTemplateChecker(object):
# TODO(crbug.com/1139046): This default check should apply to all
# policies instead of just new ones.
if self._NeedsDefault(new_policy) and new_policy.get('default',
None) == None:
if self._NeedsDefault(new_policy) and not 'default' in new_policy:
self._Error("Definition of policy %s must include a 'default'"
" field." % (new_policy_name))
......
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