Skip to content

Commit d1a5865

Browse files
author
Xi Yang
committed
Use is_public to set access of volume type
Currently the 'public' and 'private' keys does not work when creating volume type, 'is_public' should be used. Change-Id: If34a66053ea6c192882a1b9d8bbb1d3666be3f83 Closes-bug: 1520115
1 parent c48afe6 commit d1a5865

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

openstackclient/tests/volume/v2/test_type.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_type_create_public(self):
7373
self.types_mock.create.assert_called_with(
7474
volume_fakes.type_name,
7575
description=volume_fakes.type_description,
76-
public=True,
76+
is_public=True,
7777
)
7878

7979
collist = (
@@ -93,7 +93,7 @@ def test_type_create_private(self):
9393
arglist = [
9494
volume_fakes.type_name,
9595
"--description", volume_fakes.type_description,
96-
"--private"
96+
"--private",
9797
]
9898
verifylist = [
9999
("name", volume_fakes.type_name),
@@ -107,7 +107,7 @@ def test_type_create_private(self):
107107
self.types_mock.create.assert_called_with(
108108
volume_fakes.type_name,
109109
description=volume_fakes.type_description,
110-
private=True,
110+
is_public=False,
111111
)
112112

113113
collist = (

openstackclient/volume/v2/volume_type.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def take_action(self, parsed_args):
7373

7474
kwargs = {}
7575
if parsed_args.public:
76-
kwargs['public'] = True
76+
kwargs['is_public'] = True
7777
if parsed_args.private:
78-
kwargs['private'] = True
78+
kwargs['is_public'] = False
7979

8080
volume_type = volume_client.volume_types.create(
8181
parsed_args.name,

0 commit comments

Comments
 (0)