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:
parent
a899536a4d
commit
4522f5859b
@ -44,7 +44,8 @@ class KeystoneEndpoint(resource.Resource):
|
|||||||
REGION: properties.Schema(
|
REGION: properties.Schema(
|
||||||
properties.Schema.STRING,
|
properties.Schema.STRING,
|
||||||
_('Name or Id of keystone region.'),
|
_('Name or Id of keystone region.'),
|
||||||
update_allowed=True
|
update_allowed=True,
|
||||||
|
constraints=[constraints.CustomConstraint('keystone.region')]
|
||||||
),
|
),
|
||||||
SERVICE: properties.Schema(
|
SERVICE: properties.Schema(
|
||||||
properties.Schema.STRING,
|
properties.Schema.STRING,
|
||||||
|
@ -266,6 +266,14 @@ class KeystoneEndpointTest(common.HeatTestCase):
|
|||||||
'description for property %s is modified' %
|
'description for property %s is modified' %
|
||||||
endpoint.KeystoneEndpoint.REGION)
|
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):
|
def test_property_interface_validate_schema(self):
|
||||||
schema = (endpoint.KeystoneEndpoint.properties_schema[
|
schema = (endpoint.KeystoneEndpoint.properties_schema[
|
||||||
endpoint.KeystoneEndpoint.INTERFACE])
|
endpoint.KeystoneEndpoint.INTERFACE])
|
||||||
|
Loading…
Reference in New Issue
Block a user