Merge "Support boolean inputs for SoftwareConfig's"
This commit is contained in:
commit
3f5b8ee9cc
@ -81,7 +81,7 @@ class SoftwareConfig(resource.Resource):
|
|||||||
_('Type of the value of the input.'),
|
_('Type of the value of the input.'),
|
||||||
default='String',
|
default='String',
|
||||||
constraints=[constraints.AllowedValues((
|
constraints=[constraints.AllowedValues((
|
||||||
'String', 'Number', 'CommaDelimitedList', 'Json'))]
|
'String', 'Number', 'CommaDelimitedList', 'Json', 'Boolean'))]
|
||||||
),
|
),
|
||||||
DEFAULT: properties.Schema(
|
DEFAULT: properties.Schema(
|
||||||
properties.Schema.STRING,
|
properties.Schema.STRING,
|
||||||
@ -104,7 +104,7 @@ class SoftwareConfig(resource.Resource):
|
|||||||
_('Type of the value of the output.'),
|
_('Type of the value of the output.'),
|
||||||
default='String',
|
default='String',
|
||||||
constraints=[constraints.AllowedValues((
|
constraints=[constraints.AllowedValues((
|
||||||
'String', 'Number', 'CommaDelimitedList', 'Json'))]
|
'String', 'Number', 'CommaDelimitedList', 'Json', 'Boolean'))]
|
||||||
),
|
),
|
||||||
ERROR_OUTPUT: properties.Schema(
|
ERROR_OUTPUT: properties.Schema(
|
||||||
properties.Schema.BOOLEAN,
|
properties.Schema.BOOLEAN,
|
||||||
|
@ -32,6 +32,41 @@ from heat.tests import common
|
|||||||
from heat.tests.engine import tools
|
from heat.tests.engine import tools
|
||||||
from heat.tests import utils
|
from heat.tests import utils
|
||||||
|
|
||||||
|
software_config_inputs = '''
|
||||||
|
heat_template_version: 2013-05-23
|
||||||
|
description: Validate software config input/output types
|
||||||
|
|
||||||
|
resources:
|
||||||
|
|
||||||
|
InputOutputTestConfig:
|
||||||
|
type: OS::Heat::SoftwareConfig
|
||||||
|
properties:
|
||||||
|
group: puppet
|
||||||
|
inputs:
|
||||||
|
- name: boolean_input
|
||||||
|
type: Boolean
|
||||||
|
- name: json_input
|
||||||
|
type: Json
|
||||||
|
- name: number_input
|
||||||
|
type: Number
|
||||||
|
- name: string_input
|
||||||
|
type: String
|
||||||
|
- name: comma_delimited_list_input
|
||||||
|
type: CommaDelimitedList
|
||||||
|
outputs:
|
||||||
|
- name: boolean_output
|
||||||
|
type: Boolean
|
||||||
|
- name: json_output
|
||||||
|
type: Json
|
||||||
|
- name: number_output
|
||||||
|
type: Number
|
||||||
|
- name: string_output
|
||||||
|
type: String
|
||||||
|
- name: comma_delimited_list_output
|
||||||
|
type: CommaDelimitedList
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
class SoftwareConfigServiceTest(common.HeatTestCase):
|
class SoftwareConfigServiceTest(common.HeatTestCase):
|
||||||
|
|
||||||
@ -108,6 +143,15 @@ class SoftwareConfigServiceTest(common.HeatTestCase):
|
|||||||
self.ctx, config_id)
|
self.ctx, config_id)
|
||||||
self.assertEqual(exception.NotFound, ex.exc_info[0])
|
self.assertEqual(exception.NotFound, ex.exc_info[0])
|
||||||
|
|
||||||
|
def test_boolean_inputs_valid(self):
|
||||||
|
stack_name = 'test_boolean_inputs_valid'
|
||||||
|
t = template_format.parse(software_config_inputs)
|
||||||
|
stack = utils.parse_stack(t, stack_name=stack_name)
|
||||||
|
try:
|
||||||
|
stack.validate()
|
||||||
|
except exception.StackValidationFailed as exc:
|
||||||
|
self.fail("Validation should have passed: %s" % six.text_type(exc))
|
||||||
|
|
||||||
def _create_software_deployment(self, config_id=None, input_values=None,
|
def _create_software_deployment(self, config_id=None, input_values=None,
|
||||||
action='INIT',
|
action='INIT',
|
||||||
status='COMPLETE', status_reason='',
|
status='COMPLETE', status_reason='',
|
||||||
|
Loading…
Reference in New Issue
Block a user