Add an option to generate all HWID combinations
If status option is equal to 'all', combinations will include
unsupported and deprecated.
BUG=chrome-os-partner:23021
TEST=manually executed in chroot
./gooftool get_hwid_v3_list --board BOARD --status all
Change-Id: I2f9d1309723c72398c21819d70531a6e667f9352
Reviewed-on: https://chromium-review.googlesource.com/177333
Reviewed-by: Dean Liao <deanliao@chromium.org>
Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Heng-ruey Hsu <henryhsu@chromium.org>
diff --git a/py/gooftool/gooftool.py b/py/gooftool/gooftool.py
index 0471a60..629b109 100755
--- a/py/gooftool/gooftool.py
+++ b/py/gooftool/gooftool.py
@@ -986,7 +986,10 @@
@Command('get_hwid_v3_list',
_board_cmd_arg,
_hwdb_path_cmd_arg,
- CmdArg('--image_id', metavar='IMAGE_ID', help='Image ID.'))
+ CmdArg('--image_id', metavar='IMAGE_ID', help='Image ID.'),
+ CmdArg('--status', metavar='STATUS', default='supported',
+ help='Components status. The value should be '
+ '"supported" or "all"'))
def GetHWIDV3List(options):
"""Generate HWID with all components combination of specified
image_id, and output as CSV format.
@@ -996,9 +999,15 @@
image_id: Which image stage should be generated. If this parameter
is omitted, The maximum of image_id will be used.
This parameter is integer.
+ status: Default value is 'supported'. If you want to generate all
+ combinations include unsupported and deprecated, you can set
+ status to 'all'.
"""
if options.board:
- hwid_dict = GetGooftool(options).GetHWIDV3List(options.image_id)
+ if options.status not in ('supported', 'all'):
+ raise Error("Status should be 'supported' or 'all'")
+ hwid_dict = GetGooftool(options).GetHWIDV3List(options.image_id,
+ options.status)
for key, value in iter(sorted(hwid_dict.iteritems())):
print "%s,%s" % (key, value)
else: