Browse Source

Add snapshot_support property to ShareType

Add new property snapshot_support property to
Manila::ShareType resource.

Change-Id: If72ec0fd3598dba8889dc36b957b5832d1ddaf61
Closes-bug: #1541051
tags/6.0.0.0b3
Peter Razumovsky 4 years ago
parent
commit
af16d2314f
2 changed files with 15 additions and 4 deletions
  1. +13
    -3
      heat/engine/resources/openstack/manila/share_type.py
  2. +2
    -1
      heat/tests/openstack/manila/test_share_type.py

+ 13
- 3
heat/engine/resources/openstack/manila/share_type.py View File

@@ -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)


+ 2
- 1
heat/tests/openstack/manila/test_share_type.py View File

@@ -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)



Loading…
Cancel
Save