From 64afa7f2f67107bb53f940dc6fbb9a2abe03922d Mon Sep 17 00:00:00 2001 From: sahdev zala Date: Sat, 14 Jan 2017 21:11:25 -0500 Subject: [PATCH] Fix few keywords on TOSCA policy Fix few keywords to work further on the multiple policy support work Change-Id: I22ed1e9263bab84ba7635d86c39ad18b6941467d --- toscaparser/elements/policytype.py | 4 ++-- toscaparser/tests/data/policies/tosca_policy_template.yaml | 2 +- toscaparser/tests/test_toscatplvalidation.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toscaparser/elements/policytype.py b/toscaparser/elements/policytype.py index 805de95..67cdce6 100644 --- a/toscaparser/elements/policytype.py +++ b/toscaparser/elements/policytype.py @@ -20,9 +20,9 @@ from toscaparser.utils.validateutils import TOSCAVersionProperty class PolicyType(StatefulEntityType): '''TOSCA built-in policies type.''' - SECTIONS = (DERIVED_FROM, METADATA, PROPERTIES, VERSION, DESCRIPTION, TARGETS) = \ + SECTIONS = (DERIVED_FROM, METADATA, PROPERTIES, VERSION, DESCRIPTION, TARGETS, TYPE) = \ ('derived_from', 'metadata', 'properties', 'version', - 'description', 'targets') + 'description', 'targets', 'type') def __init__(self, ptype, custom_def=None): super(PolicyType, self).__init__(ptype, self.POLICY_PREFIX, diff --git a/toscaparser/tests/data/policies/tosca_policy_template.yaml b/toscaparser/tests/data/policies/tosca_policy_template.yaml index 92bebe5..47f7870 100644 --- a/toscaparser/tests/data/policies/tosca_policy_template.yaml +++ b/toscaparser/tests/data/policies/tosca_policy_template.yaml @@ -66,7 +66,7 @@ topology_template: requirement: host capability: Container condition: - constraint: utilization greater_than 50% + constraint: { greater_than: 50 } period: 60 evaluations: 1 method: average diff --git a/toscaparser/tests/test_toscatplvalidation.py b/toscaparser/tests/test_toscatplvalidation.py index a58ce58..911867f 100644 --- a/toscaparser/tests/test_toscatplvalidation.py +++ b/toscaparser/tests/test_toscatplvalidation.py @@ -1595,7 +1595,7 @@ heat-translator/master/translator/tests/data/custom_types/wordpress.yaml requirement: host capability: Container condition: - constraint: utilization greater_than 50% + constraint: { greater_than: 50 } period: 60 evaluations: 1 method : average