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
This commit is contained in:
Kanagaraj Manickam 2015-11-05 17:18:46 +05:30
parent a899536a4d
commit 4522f5859b
2 changed files with 10 additions and 1 deletions

View File

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

View File

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