@@ -30,13 +30,13 @@ def get_parser(self, prog_name):
3030 parser .add_argument (
3131 'name' ,
3232 metavar = '<name>' ,
33- help = 'New volume type name' ,
33+ help = 'Volume type name' ,
3434 )
3535 parser .add_argument (
3636 '--property' ,
3737 metavar = '<key=value>' ,
3838 action = parseractions .KeyValueAction ,
39- help = 'Property to add for this volume type '
39+ help = 'Set a property on this volume type '
4040 '(repeat option to set multiple properties)' ,
4141 )
4242 return parser
@@ -114,7 +114,7 @@ def get_parser(self, prog_name):
114114 '--property' ,
115115 metavar = '<key=value>' ,
116116 action = parseractions .KeyValueAction ,
117- help = 'Property to add or modify for this volume type '
117+ help = 'Set a property on this volume type '
118118 '(repeat option to set multiple properties)' ,
119119 )
120120 return parser
@@ -128,6 +128,27 @@ def take_action(self, parsed_args):
128128 volume_type .set_keys (parsed_args .property )
129129
130130
131+ class ShowVolumeType (command .ShowOne ):
132+ """Display volume type details"""
133+
134+ def get_parser (self , prog_name ):
135+ parser = super (ShowVolumeType , self ).get_parser (prog_name )
136+ parser .add_argument (
137+ "volume_type" ,
138+ metavar = "<volume-type>" ,
139+ help = "Volume type to display (name or ID)"
140+ )
141+ return parser
142+
143+ def take_action (self , parsed_args ):
144+ volume_client = self .app .client_manager .volume
145+ volume_type = utils .find_resource (
146+ volume_client .volume_types , parsed_args .volume_type )
147+ properties = utils .format_dict (volume_type ._info .pop ('extra_specs' ))
148+ volume_type ._info .update ({'properties' : properties })
149+ return zip (* sorted (six .iteritems (volume_type ._info )))
150+
151+
131152class UnsetVolumeType (command .Command ):
132153 """Unset volume type properties"""
133154
@@ -143,7 +164,7 @@ def get_parser(self, prog_name):
143164 metavar = '<key>' ,
144165 action = 'append' ,
145166 default = [],
146- help = 'Property to remove from volume type '
167+ help = 'Remove a property from this volume type '
147168 '(repeat option to remove multiple properties)' ,
148169 required = True ,
149170 )
@@ -160,24 +181,3 @@ def take_action(self, parsed_args):
160181 volume_type .unset_keys (parsed_args .property )
161182 else :
162183 self .app .log .error ("No changes requested\n " )
163-
164-
165- class ShowVolumeType (command .ShowOne ):
166- """Display volume type details"""
167-
168- def get_parser (self , prog_name ):
169- parser = super (ShowVolumeType , self ).get_parser (prog_name )
170- parser .add_argument (
171- "volume_type" ,
172- metavar = "<volume-type>" ,
173- help = "Volume type to display (name or ID)"
174- )
175- return parser
176-
177- def take_action (self , parsed_args ):
178- volume_client = self .app .client_manager .volume
179- volume_type = utils .find_resource (
180- volume_client .volume_types , parsed_args .volume_type )
181- properties = utils .format_dict (volume_type ._info .pop ('extra_specs' ))
182- volume_type ._info .update ({'properties' : properties })
183- return zip (* sorted (six .iteritems (volume_type ._info )))
0 commit comments