summaryrefslogtreecommitdiff
path: root/compute/gcloud.py
diff options
context:
space:
mode:
authorPrathmesh Prabhu <pprabhu@chromium.org>2015-03-24 19:33:29 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-03-31 06:31:05 +0000
commitba9eeca977c7c9b92450bc33caa4a077a35771a9 (patch)
treeac4d6ea9845f52befcf40800e9f3073777f298f3 /compute/gcloud.py
parentf58da0733420add4dabe8326b8919819947874e2 (diff)
downloadchromite-ba9eeca977c7c9b92450bc33caa4a077a35771a9.tar.gz
cros_compute: Add a quiet flag.
gcloud cli has a quiet flag to supress user prompts. Add it to our own cli to allow scripting. BUG=None. TEST=Used the new flag in a contrib script. Change-Id: I4bedd06f379e8b4609e6f6dd9297f066b752470b Reviewed-on: https://chromium-review.googlesource.com/262307 Tested-by: Prathmesh Prabhu <pprabhu@chromium.org> Trybot-Ready: Prathmesh Prabhu <pprabhu@chromium.org> Reviewed-by: Fang Deng <fdeng@chromium.org> Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Diffstat (limited to 'compute/gcloud.py')
-rw-r--r--compute/gcloud.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/compute/gcloud.py b/compute/gcloud.py
index a9c10f8bd..819f8b556 100644
--- a/compute/gcloud.py
+++ b/compute/gcloud.py
@@ -209,16 +209,19 @@ class GCContext(object):
return ret
- def DeleteInstance(self, instance, keep_disks=None, **kwargs):
- """Deletes |instance|. User will be prompted to confirm.
+ def DeleteInstance(self, instance, quiet=False, keep_disks=None, **kwargs):
+ """Deletes |instance|.
Args:
instance: Name of the instance.
+ quiet: Silent delete instance without prompting the user.
keep_disks: Keep the type of the disk; valid types are
'boot', 'data', and 'all'.
kwargs: See DoCommand.
"""
cmd = ['instances', 'delete', instance]
+ if quiet:
+ cmd += ['-q']
if keep_disks:
cmd += ['--keep-disks', keep_disks]