Merge "Update the constraint value of schema 'ACCESS_TYPE' for Manila share"

This commit is contained in:
Jenkins 2016-12-21 07:29:01 +00:00 committed by Gerrit Code Review
commit 77d94c2312
3 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,7 @@ from heat.engine import constraints
from manilaclient import client as manila_client
from manilaclient import exceptions
MANILACLIENT_VERSION = "1"
MANILACLIENT_VERSION = "2"
CLIENT_NAME = 'manila'

View File

@ -139,7 +139,7 @@ class ManilaShare(resource.Resource):
properties.Schema.STRING,
_('Type of access that should be provided to guest.'),
constraints=[constraints.AllowedValues(
['ip', 'domain'])],
['ip', 'user', 'cert', 'cephx'])],
required=True
),
ACCESS_LEVEL: properties.Schema(

View File

@ -223,3 +223,13 @@ class ManilaShareTest(common.HeatTestCase):
self.assertEqual('ca', share.FnGetAtt('created_at'))
self.assertEqual('s', share.FnGetAtt('status'))
self.assertEqual('p_id', share.FnGetAtt('project_id'))
def test_allowed_access_type(self):
tmp = template_format.parse(manila_template)
properties = tmp['resources']['test_share']['properties']
properties['access_rules'][0]['access_type'] = 'domain'
stack = utils.parse_stack(tmp, stack_name='access_type')
self.assertRaisesRegexp(
exception.StackValidationFailed,
".* \"domain\" is not an allowed value \[ip, user, cert, cephx\]",
stack.validate)