@@ -62,7 +62,7 @@ def _format_namespace(namespace):
6262 return info
6363
6464
65- class CreateMetadefNameSpace (command .ShowOne ):
65+ class CreateMetadefNamespace (command .ShowOne ):
6666 _description = _ ("Create a metadef namespace" )
6767
6868 def get_parser (self , prog_name ):
@@ -136,26 +136,26 @@ def take_action(self, parsed_args):
136136 return zip (* sorted (info .items ()))
137137
138138
139- class DeleteMetadefNameSpace (command .Command ):
139+ class DeleteMetadefNamespace (command .Command ):
140140 _description = _ ("Delete metadef namespace" )
141141
142142 def get_parser (self , prog_name ):
143143 parser = super ().get_parser (prog_name )
144144 parser .add_argument (
145- "namespace_name " ,
146- metavar = "<namespace_name >" ,
145+ "namespace " ,
146+ metavar = "<namespace >" ,
147147 nargs = "+" ,
148- help = _ ("An identifier (a name) for the namespace " ),
148+ help = _ ("Metadef namespace(s) to delete (name) " ),
149149 )
150150 return parser
151151
152152 def take_action (self , parsed_args ):
153153 image_client = self .app .client_manager .image
154154
155155 result = 0
156- for i in parsed_args .namespace_name :
156+ for ns in parsed_args .namespace :
157157 try :
158- namespace = image_client .get_metadef_namespace (i )
158+ namespace = image_client .get_metadef_namespace (ns )
159159 image_client .delete_metadef_namespace (namespace .id )
160160 except Exception as e :
161161 result += 1
@@ -164,18 +164,18 @@ def take_action(self, parsed_args):
164164 "Failed to delete namespace with name or "
165165 "ID '%(namespace)s': %(e)s"
166166 ),
167- {'namespace' : i , 'e' : e },
167+ {'namespace' : ns , 'e' : e },
168168 )
169169
170170 if result > 0 :
171- total = len (parsed_args .namespace_name )
171+ total = len (parsed_args .namespace )
172172 msg = _ (
173173 "%(result)s of %(total)s namespace failed " "to delete."
174174 ) % {'result' : result , 'total' : total }
175175 raise exceptions .CommandError (msg )
176176
177177
178- class ListMetadefNameSpaces (command .Lister ):
178+ class ListMetadefNamespace (command .Lister ):
179179 _description = _ ("List metadef namespaces" )
180180
181181 def get_parser (self , prog_name ):
@@ -217,15 +217,15 @@ def take_action(self, parsed_args):
217217 )
218218
219219
220- class SetMetadefNameSpace (command .Command ):
220+ class SetMetadefNamespace (command .Command ):
221221 _description = _ ("Set metadef namespace properties" )
222222
223223 def get_parser (self , prog_name ):
224224 parser = super ().get_parser (prog_name )
225225 parser .add_argument (
226226 "namespace" ,
227227 metavar = "<namespace>" ,
228- help = _ ("Namespace (name) for the namespace " ),
228+ help = _ ("Metadef namespace to modify (name) " ),
229229 )
230230 parser .add_argument (
231231 "--display-name" ,
@@ -243,14 +243,16 @@ def get_parser(self, prog_name):
243243 action = "store_const" ,
244244 const = "public" ,
245245 dest = "visibility" ,
246- help = _ ("Set namespace visibility ' public' " ),
246+ help = _ ("Metadef namespace is accessible to the public" ),
247247 )
248248 visibility_group .add_argument (
249249 "--private" ,
250250 action = "store_const" ,
251251 const = "private" ,
252252 dest = "visibility" ,
253- help = _ ("Set namespace visibility 'private'" ),
253+ help = _ (
254+ "Metadef namespace is inaccessible to the public (default)"
255+ ),
254256 )
255257 protected_group = parser .add_mutually_exclusive_group ()
256258 protected_group .add_argument (
@@ -291,24 +293,24 @@ def take_action(self, parsed_args):
291293 image_client .update_metadef_namespace (namespace , ** kwargs )
292294
293295
294- class ShowMetadefNameSpace (command .ShowOne ):
296+ class ShowMetadefNamespace (command .ShowOne ):
295297 _description = _ ("Show a metadef namespace" )
296298
297299 def get_parser (self , prog_name ):
298300 parser = super ().get_parser (prog_name )
299301 parser .add_argument (
300- "namespace_name " ,
301- metavar = "<namespace_name >" ,
302- help = _ ("Namespace (name) for the namespace " ),
302+ "namespace " ,
303+ metavar = "<namespace >" ,
304+ help = _ ("Metadef namespace to show (name) " ),
303305 )
304306 return parser
305307
306308 def take_action (self , parsed_args ):
307309 image_client = self .app .client_manager .image
308310
309- namespace_name = parsed_args .namespace_name
311+ namespace = parsed_args .namespace
310312
311- data = image_client .get_metadef_namespace (namespace_name )
313+ data = image_client .get_metadef_namespace (namespace )
312314 info = _format_namespace (data )
313315
314316 return zip (* sorted (info .items ()))
0 commit comments