Add attributes property to OS::Designate::Zone

Task: 51416
Change-Id: Ica6626a84222057b5076c73363857831e9426e50
Signed-off-by: rabi <ramishra@redhat.com>
This commit is contained in:
rabi 2024-11-27 13:25:48 +05:30
parent eeaf67d56f
commit 042bed8044
No known key found for this signature in database
GPG Key ID: BD3F14C72521FE94
3 changed files with 25 additions and 3 deletions

View File

@ -32,9 +32,11 @@ class DesignateZone(resource.Resource):
version='8.0.0')
PROPERTIES = (
NAME, TTL, DESCRIPTION, EMAIL, TYPE, PRIMARIES, MASTERS
NAME, TTL, DESCRIPTION, EMAIL, TYPE, PRIMARIES,
MASTERS, ATTRS,
) = (
'name', 'ttl', 'description', 'email', 'type', 'primaries', 'masters'
'name', 'ttl', 'description', 'email', 'type', 'primaries',
'masters', 'attributes',
)
ATTRIBUTES = (
@ -103,6 +105,14 @@ class DesignateZone(resource.Resource):
'Mandatory for zone type SECONDARY, otherwise ignored.'),
update_allowed=True
),
ATTRS: properties.Schema(
properties.Schema.MAP,
_('Key:Value pairs of information about this zone, '
'and the pool the user would like to place the zone in. '
'This information can be used by the scheduler to place '
'zones on the correct pool.'),
support_status=support.SupportStatus(version='24.0.0')
),
}
attributes_schema = {

View File

@ -32,6 +32,9 @@ sample_template = {
'name': 'test-zone.com',
'description': 'Test zone',
'ttl': 3600,
'attributes': {
'tier': 'gold', 'ha': 'true'
},
'email': 'abc@test-zone.com',
'type': 'PRIMARY',
'masters': []
@ -108,7 +111,8 @@ class DesignateZoneTest(common.HeatTestCase):
description='Test zone',
ttl=3600,
email='abc@test-zone.com',
type_='PRIMARY'
type_='PRIMARY',
attributes=dict(tier='gold', ha='true')
)
mock_zone_create.assert_called_once_with(**args)

View File

@ -0,0 +1,8 @@
---
features:
- |
Added ``attributes`` property to resource type
``OS::Designate::Zone``. It can be any key:value
pairs of information about this zone including the
pool where the user wants to place the zone used
by scheduler.