cgpt.py: report section name when asserting bad format
It is good to know what exact layout section is in error when the
conflicting setting assertion is raised.
BUG=none
TEST=tried running cgpt.py with an incorrect json file, observed
section name reported in the error message.
Change-Id: I4ba7d60913414c8ea681c10410aa9d45da67e9ce
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/250833
Reviewed-by: Daniel Ehrenberg <dehrenberg@chromium.org>
diff --git a/build_library/cgpt.py b/build_library/cgpt.py
index 76649aa..dae645b 100755
--- a/build_library/cgpt.py
+++ b/build_library/cgpt.py
@@ -340,8 +340,9 @@
if 'size' in part:
if 'blocks' in part:
raise ConflictingOptions(
- 'Conflicting settings are used. '
- 'Found section sets both \'blocks\' and \'size\'.')
+ '%s: Conflicting settings are used. '
+ 'Found section sets both \'blocks\' and \'size\'.' %
+ part['label'])
part['bytes'] = ParseHumanNumber(part['size'])
part['blocks'] = part['bytes'] / metadata['block_size']