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:
parent
864df5b69d
commit
da8c2348a7
@ -10,7 +10,6 @@ Properties:
|
||||
|
||||
defaultGroupName:
|
||||
Contract: $.string()
|
||||
Usage: Runtime
|
||||
Default: format('MuranoSecurityGroup-{0}', $.environment.name)
|
||||
|
||||
Methods:
|
||||
|
@ -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:
|
||||
|
11
murano/tests/unit/dsl/meta/PropertyInit.yaml
Normal file
11
murano/tests/unit/dsl/meta/PropertyInit.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
Name: PropertyInit
|
||||
|
||||
Properties:
|
||||
runtimeProperty:
|
||||
Usage: Runtime
|
||||
Contract: $.string()
|
||||
|
||||
Methods:
|
||||
testPropertyAccess:
|
||||
Body:
|
||||
- Return: $this.runtimeProperty
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user