Updates keystone region constraints for endpoint

OS::Keystone::Endpoint region property is updated to
validate with keystone.region

implements blueprint: heat-keystone-region-resource

Change-Id: I4bc75c428d10376711d3852d240e4da6e46f36cc
changes/14/242014/8
Kanagaraj Manickam 7 years ago
parent a899536a4d
commit 4522f5859b

@ -44,7 +44,8 @@ class KeystoneEndpoint(resource.Resource):
REGION: properties.Schema(
properties.Schema.STRING,
_('Name or Id of keystone region.'),
update_allowed=True
update_allowed=True,
constraints=[constraints.CustomConstraint('keystone.region')]
),
SERVICE: properties.Schema(
properties.Schema.STRING,

@ -266,6 +266,14 @@ class KeystoneEndpointTest(common.HeatTestCase):
'description for property %s is modified' %
endpoint.KeystoneEndpoint.REGION)
# Make sure, REGION is of keystone.region custom constraint type
self.assertEqual(1, len(schema.constraints))
keystone_region_constraint = schema.constraints[0]
self.assertIsInstance(keystone_region_constraint,
constraints.CustomConstraint)
self.assertEqual('keystone.region',
keystone_region_constraint.name)
def test_property_interface_validate_schema(self):
schema = (endpoint.KeystoneEndpoint.properties_schema[
endpoint.KeystoneEndpoint.INTERFACE])

Loading…
Cancel
Save