Commit 43d6cbe7 authored by Chris Sharp's avatar Chris Sharp Committed by Commit Bot

Update policy_json.py to handle enums without a name

No-Presubmit: true
Bug: 1146426
Change-Id: Idaca0e26e8414d42ffccfccdd8e2a95cf2363770
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522235
Commit-Queue: Chris Sharp <csharp@chromium.org>
Reviewed-by: default avatarYann Dago <ydago@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825396}
parent 4db40c74
...@@ -168,9 +168,16 @@ class PolicyJson(skeleton_gatherer.SkeletonGatherer): ...@@ -168,9 +168,16 @@ class PolicyJson(skeleton_gatherer.SkeletonGatherer):
(key_map[key], item['name'], (key_map[key], item['name'],
','.join(item['owners'] if 'owners' in item else 'unknown'))) ','.join(item['owners'] if 'owners' in item else 'unknown')))
if item_type == 'enum_item': if item_type == 'enum_item':
return ('%s of the option named %s in policy %s [owner(s): %s]' % if 'name' in item:
(key_map[key], item['name'], parent_item['name'], return ('%s of the option named %s in policy %s [owner(s): %s]' %
','.join(parent_item['owners'] if 'owners' in parent_item else 'unknown'))) (key_map[key], item['name'], parent_item['name'],
','.join(parent_item['owners'] if 'owners' in
parent_item else 'unknown')))
else:
return ('%s of the option with value %s in policy %s [owner(s): %s]' %
(key_map[key], item['value'], parent_item['name'],
','.join(parent_item['owners'] if 'owners' in
parent_item else 'unknown')))
raise Exception('Unexpected type %s' % item_type) raise Exception('Unexpected type %s' % item_type)
def _AddSchemaKeys(self, obj, depth): def _AddSchemaKeys(self, obj, depth):
......
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