From db1fabed118a771dfb85024c67ae348119aec412 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 11 Jul 2012 16:25:13 -0700 Subject: [PATCH 1/2] Properly map boolean-like arguments to True/False --is-public and --is-protected are now evaluated as True and False Fix bug 1023652 Change-Id: Ife2313770eebc176e7744711956aed20f16576a5 --- glanceclient/v1/shell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py index fdd8d80f..abe165eb 100644 --- a/glanceclient/v1/shell.py +++ b/glanceclient/v1/shell.py @@ -163,9 +163,9 @@ def do_image_create(gc, args): help=('Similar to \'--location\' in usage, but this indicates that' ' the Glance server should immediately copy the data and' ' store it in its configured image store.')) -@utils.arg('--is-public', type=bool, +@utils.arg('--is-public', type=utils.string_to_bool, help='Make image accessible to the public.') -@utils.arg('--is-protected', type=bool, +@utils.arg('--is-protected', type=utils.string_to_bool, help='Prevent image from being deleted.') @utils.arg('--property', metavar="", action='append', default=[], help=("Arbitrary property to associate with image. " From d8433ee40a6a8ea3af70572ad1928edd09636309 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 11 Jul 2012 16:19:08 -0700 Subject: [PATCH 2/2] Change --protected to --is-protected in create Make image-create match image-update when specifying a specific value for 'protected'. Fix bug 1023650 Change-Id: I02ddeb59c1f6882b206279a71f7af8889ce4602c --- glanceclient/v1/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py index abe165eb..da3b6dc1 100644 --- a/glanceclient/v1/shell.py +++ b/glanceclient/v1/shell.py @@ -102,7 +102,7 @@ def do_image_show(gc, args): ' store it in its configured image store.')) @utils.arg('--public', action='store_true', default=False, help='Make image accessible to the public.') -@utils.arg('--protected', action='store_true', default=False, +@utils.arg('--is-protected', type=utils.string_to_bool, help='Prevent image from being deleted.') @utils.arg('--property', metavar="", action='append', default=[], help=("Arbitrary property to associate with image. "