Merge "trivial: Make better use of argparse"

This commit is contained in:
Zuul 2023-10-31 15:00:24 +00:00 committed by Gerrit Code Review
commit dfcb8b0ee7
2 changed files with 5 additions and 1 deletions

View File

@ -171,6 +171,7 @@ class TestTypeCreate(TestType):
self.new_volume_type.name,
]
verifylist = [
('is_public', None),
('project', self.project.id),
('name', self.new_volume_type.name),
]

View File

@ -250,11 +250,14 @@ class CreateVolumeType(command.ShowOne):
raise exceptions.CommandError(msg)
kwargs = {}
if parsed_args.is_public is not None:
kwargs['is_public'] = parsed_args.is_public
volume_type = volume_client.volume_types.create(
parsed_args.name, description=parsed_args.description, **kwargs
parsed_args.name,
description=parsed_args.description,
**kwargs,
)
volume_type._info.pop('extra_specs')