diff options
author | David Pursell <dpursell@chromium.org> | 2015-04-27 11:52:39 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-01 19:38:29 +0000 |
commit | 0360420340c04b4c45a0df53148e29f0d6c76cce (patch) | |
tree | 9ff5828a653050fa9409a8e259d149a14fc82edd /cli/cros/cros_deploy.py | |
parent | 02172e973369fb61c96505f279a74b22542ec8c7 (diff) | |
download | chromite-0360420340c04b4c45a0df53148e29f0d6c76cce.tar.gz |
brillo CLI: Normalize brick/blueprint input.
This adds some additional types for ArgumentParser args to support
normalizing blueprint/brick/BSP paths and putting in some smarts to
help the user easily specify targets.
blueprint_path:
* If not a path, put in //blueprints.
* Add .json extension if not already present.
* Convert to workspace locator if not already.
brick_path:
* If not a path, put in //bricks.
* Convert to workspace locator if not already.
bsp_path:
* If not a path, put in //bsps.
* Convert to workspace locator if not already.
This allows the user to more easily specify bricks and blueprints, so
that the following two commands will be equivalent:
$ brillo xxx --blueprint //blueprints/foo.json --brick //bricks/bar
$ brillo xxx --blueprint foo --brick bar
BUG=brillo:907, brillo:931
TEST=cbuildbot/run_tests
TEST=brillo brick create foo
brillo brick create //bsps/bar
brillo blueprint create fooprint --bsp bar --brick foo
Change-Id: I0707f0681e646b7d2bf9dd4717ef37b68e1b64fd
Reviewed-on: https://chromium-review.googlesource.com/268449
Reviewed-by: David Pursell <dpursell@chromium.org>
Commit-Queue: David Pursell <dpursell@chromium.org>
Trybot-Ready: David Pursell <dpursell@chromium.org>
Tested-by: David Pursell <dpursell@chromium.org>
Diffstat (limited to 'cli/cros/cros_deploy.py')
-rw-r--r-- | cli/cros/cros_deploy.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/cros/cros_deploy.py b/cli/cros/cros_deploy.py index 5c87f8e50..424280b92 100644 --- a/cli/cros/cros_deploy.py +++ b/cli/cros/cros_deploy.py @@ -57,7 +57,7 @@ For more information of cros build usage: help='The board to use. By default it is automatically detected. You ' 'can override the detected board with this option.') target.add_argument( - '--brick', + '--brick', type='brick_path', help='The brick to use. Will be detected from CWD if possible and take ' 'precedence over the detected board.') parser.add_argument( |