Fix property initialization

* Skip runtime properties initialization
* Fix usage of defaultGroupName property in SecurityGroupManager

Co-Authored-By: Stan Lagun <slagun@mirantis.com>
Closes-Bug: #1363253
Change-Id: I869f45bf31f8b7480624a5bfb5f3690ccdb9abc4
This commit is contained in:
Serg Melikyan 2014-09-01 11:14:26 +04:00
parent 864df5b69d
commit da8c2348a7
4 changed files with 18 additions and 1 deletions

View File

@ -10,7 +10,6 @@ Properties:
defaultGroupName:
Contract: $.string()
Usage: Runtime
Default: format('MuranoSecurityGroup-{0}', $.environment.name)
Methods:

View File

@ -54,6 +54,8 @@ class MuranoObject(object):
for i in xrange(2):
for property_name in self.__type.properties:
spec = self.__type.get_property(property_name)
if spec.usage == typespec.PropertyUsages.Runtime:
continue
needs_evaluation = murano.dsl.helpers.needs_evaluation
if i == 0 and needs_evaluation(spec.default) or i == 1\
and property_name in used_names:

View File

@ -0,0 +1,11 @@
Name: PropertyInit
Properties:
runtimeProperty:
Usage: Runtime
Contract: $.string()
Methods:
testPropertyAccess:
Body:
- Return: $this.runtimeProperty

View File

@ -113,3 +113,8 @@ class TestPropertyAccess(test_case.DslTestCase):
exceptions.NoWriteAccessError,
self._runner.on(self._multi_derived).
testModifyUsageTestProperty6)
def test_runtime_properties_skipped_on_initialize(self):
model = om.Object('PropertyInit', runtimeProperty='value')
runner = self.new_runner(model)
self.assertRaises(KeyError, runner.testPropertyAccess)