From 37231b5801162c9fcbd2a704a6660021dda6327d Mon Sep 17 00:00:00 2001 From: Terry Howe <terrylhowe@gmail.com> Date: Tue, 22 Apr 2014 09:08:52 -0600 Subject: [PATCH] volume type create should display properties The volume type create command should properly output the properties. The code was doing a create on the volume type and then setting the properties, but it was printing out the volume object from the create. Change-Id: I23c8a0182e77bb71903ad87c1b01ba2b62405f3b Closes-Bug: #1303978 --- openstackclient/volume/v1/type.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/openstackclient/volume/v1/type.py b/openstackclient/volume/v1/type.py index edacb397e5..b199b7c3e0 100644 --- a/openstackclient/volume/v1/type.py +++ b/openstackclient/volume/v1/type.py @@ -50,16 +50,11 @@ class CreateVolumeType(show.ShowOne): def take_action(self, parsed_args): self.log.debug('take_action(%s)' % parsed_args) volume_client = self.app.client_manager.volume - volume_type = volume_client.volume_types.create( - parsed_args.name - ) + volume_type = volume_client.volume_types.create(parsed_args.name) + volume_type._info.pop('extra_specs') if parsed_args.property: - volume_type.set_keys(parsed_args.property) - # Map 'extra_specs' column to 'properties' - volume_type._info.update( - {'properties': utils.format_dict( - volume_type._info.pop('extra_specs'))} - ) + result = volume_type.set_keys(parsed_args.property) + volume_type._info.update({'properties': utils.format_dict(result)}) info = {} info.update(volume_type._info)