diff --git a/heat/engine/resources/openstack/manila/share_type.py b/heat/engine/resources/openstack/manila/share_type.py index 25facdd997..1ab9e8ba0f 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 bca8b5ff16..b69632cfa3 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)