From d0851c32ed7622406e79742d17b25112fd73b432 Mon Sep 17 00:00:00 2001 From: Michal Dulko Date: Fri, 19 Sep 2014 11:38:24 +0200 Subject: [PATCH] Remove readonly options from v2 shell commands This commit is removing the read-only properties from shell options to prevent user from doing invalid requests using the client. Change-Id: I17e9578e705bd3cf628fe39630ebecc4ea43e392 Closes-Bug: 1350802 --- glanceclient/v2/shell.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py index 7f566094..bed4e13f 100644 --- a/glanceclient/v2/shell.py +++ b/glanceclient/v2/shell.py @@ -35,7 +35,9 @@ def get_image_schema(): return IMAGE_SCHEMA -@utils.schema_args(get_image_schema) +@utils.schema_args(get_image_schema, omit=['created_at', 'updated_at', 'file', + 'checksum', 'virtual_size', 'size', + 'status', 'schema', 'direct_url']) @utils.arg('--property', metavar="", action='append', default=[], help=('Arbitrary property to associate with image.' ' May be used multiple times.')) @@ -58,7 +60,10 @@ def do_image_create(gc, args): @utils.arg('id', metavar='', help='ID of image to update.') -@utils.schema_args(get_image_schema, omit=['id', 'locations', 'tags']) +@utils.schema_args(get_image_schema, omit=['id', 'locations', 'created_at', + 'updated_at', 'file', 'checksum', + 'virtual_size', 'size', 'status', + 'schema', 'direct_url', 'tags']) @utils.arg('--property', metavar="", action='append', default=[], help=('Arbitrary property to associate with image.' ' May be used multiple times.'))