Commit 5abf5aab authored by Owen Min's avatar Owen Min Committed by Commit Bot

Fix an issue in policy presubmit script

When policy changing name, _CheckDeprecatedFutureField() function crash
as there is no |new_policy| instance.

Add a check in the first call to resolve the issue. Note that, for
renamed or new added policy, it should be verified by the second call
which always has the |new_policy| instance.

Bug: 1076560
Tbr: pastarmovj@chromium.org

Change-Id: I32d6e9b8b8b00cb9db4a1d34e0023aa8060fe6ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284611
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: default avatarSaurabh Nijhara <snijhara@google.com>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785756}
parent b34136c5
...@@ -1357,8 +1357,9 @@ class PolicyTemplateChecker(object): ...@@ -1357,8 +1357,9 @@ class PolicyTemplateChecker(object):
MergeDict(new_released_platforms, new_rolling_out_platform), MergeDict(new_released_platforms, new_rolling_out_platform),
current_version, original_policy['name']) current_version, original_policy['name'])
self._CheckDeprecatedFutureField(original_policy, new_policy, if new_policy:
original_policy['name']) self._CheckDeprecatedFutureField(original_policy, new_policy,
original_policy['name'])
# Check brand new policies: # Check brand new policies:
for new_policy_name in set( for new_policy_name in set(
......
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