diff --git a/openstackclient/tests/unit/volume/v2/test_volume_type.py b/openstackclient/tests/unit/volume/v2/test_volume_type.py index 2157eabccd..ca6971e536 100644 --- a/openstackclient/tests/unit/volume/v2/test_volume_type.py +++ b/openstackclient/tests/unit/volume/v2/test_volume_type.py @@ -173,6 +173,7 @@ class TestTypeCreate(TestType): self.new_volume_type.name, ] verifylist = [ + ('is_public', None), ('project', self.project.id), ('name', self.new_volume_type.name), ] diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py index ebb364b5d8..f865c8247c 100644 --- a/openstackclient/volume/v2/volume_type.py +++ b/openstackclient/volume/v2/volume_type.py @@ -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')