From b7f476e2112c7d272bbf1e508f2aa8c4641efe68 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 11 Jul 2012 16:32:53 -0700 Subject: [PATCH] Translate is_protected to protected When creating or updating an image, translate the 'is_protected' argument into the proper 'protected' image attribute. Fix bug 1023653 Change-Id: Icfe6c38e4fda098ce3f90fd94c8fbbc18be2f4a8 --- glanceclient/v1/shell.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py index da3b6dc1..ceb19188 100644 --- a/glanceclient/v1/shell.py +++ b/glanceclient/v1/shell.py @@ -113,6 +113,9 @@ def do_image_create(gc, args): fields['is_public'] = fields.pop('public') + if 'is_protected' in fields: + fields['protected'] = fields.pop('is_protected') + raw_properties = fields.pop('property') fields['properties'] = {} for datum in raw_properties: @@ -180,6 +183,9 @@ def do_image_update(gc, args): image_id = fields.pop('id') + if 'is_protected' in fields: + fields['protected'] = fields.pop('is_protected') + raw_properties = fields.pop('property') fields['properties'] = {} for datum in raw_properties: