summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorXi Yang <yang.xi@99cloud.net>2015-11-08 23:22:51 +0800
committerXi Yang <yang.xi@99cloud.net>2015-11-26 16:30:05 +0800
commitd1a58653ab8c3a98f2315ebbffd5e86be0beb966 (patch)
treeb638a0401cd3c9ec2170c74ee248d90581dfd1c4 /openstackclient
parentc48afe6032ad53fcdc12c749adfe2d0f006fef14 (diff)
downloadpython-openstackclient-d1a58653ab8c3a98f2315ebbffd5e86be0beb966.tar.gz
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
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/tests/volume/v2/test_type.py6
-rw-r--r--openstackclient/volume/v2/volume_type.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/openstackclient/tests/volume/v2/test_type.py b/openstackclient/tests/volume/v2/test_type.py
index 9a07263b..c63cd1fa 100644
--- a/openstackclient/tests/volume/v2/test_type.py
+++ b/openstackclient/tests/volume/v2/test_type.py
@@ -73,7 +73,7 @@ class TestTypeCreate(TestType):
self.types_mock.create.assert_called_with(
volume_fakes.type_name,
description=volume_fakes.type_description,
- public=True,
+ is_public=True,
)
collist = (
@@ -93,7 +93,7 @@ class TestTypeCreate(TestType):
arglist = [
volume_fakes.type_name,
"--description", volume_fakes.type_description,
- "--private"
+ "--private",
]
verifylist = [
("name", volume_fakes.type_name),
@@ -107,7 +107,7 @@ class TestTypeCreate(TestType):
self.types_mock.create.assert_called_with(
volume_fakes.type_name,
description=volume_fakes.type_description,
- private=True,
+ is_public=False,
)
collist = (
diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py
index 8cca86f9..583e6ed9 100644
--- a/openstackclient/volume/v2/volume_type.py
+++ b/openstackclient/volume/v2/volume_type.py
@@ -73,9 +73,9 @@ class CreateVolumeType(show.ShowOne):
kwargs = {}
if parsed_args.public:
- kwargs['public'] = True
+ kwargs['is_public'] = True
if parsed_args.private:
- kwargs['private'] = True
+ kwargs['is_public'] = False
volume_type = volume_client.volume_types.create(
parsed_args.name,