summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-04 12:52:39 +0000
committerGerrit Code Review <review@openstack.org>2016-02-04 12:52:39 +0000
commit98fc4c7e37cce28d696f0f207e004f4639042065 (patch)
treebd4594aaaa4216c6b6787a872dc78fd2dd051040
parent5a773baa589d6283a0c2f597dd36c32bb6ade7cf (diff)
parentaf16d2314f4bb3795e44c5b2b741a267d0372fa3 (diff)
downloadheat-98fc4c7e37cce28d696f0f207e004f4639042065.tar.gz
Merge "Add snapshot_support property to ShareType"
-rw-r--r--heat/engine/resources/openstack/manila/share_type.py16
-rw-r--r--heat/tests/openstack/manila/test_share_type.py3
2 files changed, 15 insertions, 4 deletions
diff --git a/heat/engine/resources/openstack/manila/share_type.py b/heat/engine/resources/openstack/manila/share_type.py
index 25facdd99..1ab9e8ba0 100644
--- a/heat/engine/resources/openstack/manila/share_type.py
+++ b/heat/engine/resources/openstack/manila/share_type.py
@@ -33,9 +33,11 @@ class ManilaShareType(resource.Resource):
support_status = support.SupportStatus(version='5.0.0')
PROPERTIES = (
- NAME, IS_PUBLIC, DRIVER_HANDLES_SHARE_SERVERS, EXTRA_SPECS
+ NAME, IS_PUBLIC, DRIVER_HANDLES_SHARE_SERVERS, EXTRA_SPECS,
+ SNAPSHOT_SUPPORT
) = (
- 'name', 'is_public', 'driver_handles_share_servers', 'extra_specs'
+ 'name', 'is_public', 'driver_handles_share_servers', 'extra_specs',
+ 'snapshot_support'
)
properties_schema = {
@@ -59,6 +61,13 @@ class ManilaShareType(resource.Resource):
properties.Schema.MAP,
_("Extra specs key-value pairs defined for share type."),
update_allowed=True
+ ),
+ SNAPSHOT_SUPPORT: properties.Schema(
+ properties.Schema.BOOLEAN,
+ _('Boolean extra spec that used for filtering of backends by '
+ 'their capability to create share snapshots.'),
+ support_status=support.SupportStatus(version='6.0.0'),
+ default=True
)
}
@@ -71,7 +80,8 @@ class ManilaShareType(resource.Resource):
name=self.properties.get(self.NAME),
spec_driver_handles_share_servers=self.properties.get(
self.DRIVER_HANDLES_SHARE_SERVERS),
- is_public=self.properties.get(self.IS_PUBLIC)
+ is_public=self.properties.get(self.IS_PUBLIC),
+ spec_snapshot_support=self.properties.get(self.SNAPSHOT_SUPPORT)
)
self.resource_id_set(share_type.id)
extra_specs = self.properties.get(self.EXTRA_SPECS)
diff --git a/heat/tests/openstack/manila/test_share_type.py b/heat/tests/openstack/manila/test_share_type.py
index bca8b5ff1..b69632cfa 100644
--- a/heat/tests/openstack/manila/test_share_type.py
+++ b/heat/tests/openstack/manila/test_share_type.py
@@ -33,6 +33,7 @@ resources:
driver_handles_share_servers: True
extra_specs: {"test":"test"}
is_public: False
+ snapshot_support: True
"""
@@ -75,7 +76,7 @@ class ManilaShareTypeTest(common.HeatTestCase):
self.assertEqual("type_id", share_type.resource_id)
share_type.client().share_types.create.assert_called_once_with(
name="test_share_type", spec_driver_handles_share_servers=True,
- is_public=False)
+ is_public=False, spec_snapshot_support=True)
fake_share_type.set_keys.assert_called_once_with({"test": "test"})
self.assertEqual('share_types', share_type.entity)