HOT outputs were merged

This commit does dot HOT template outputs (for Heat.HOT/1.0 format)
the same that was previously done for the inputs. Instead of generating
MuranoPL property per each output now all outputs are put into a
single 'templateOutputs' property. This allows to eliminate the constraints
on output names, not to have collisions with input names and remain
consistent with previous changes.

Change-Id: Ibbd0a2f410c55385cd3cb9e85ea135a36460afe7
Closes-Bug: #1520954
This commit is contained in:
Stan Lagun 2015-12-02 12:43:44 +03:00
parent ce6a29d6a2
commit 6f013c5722
2 changed files with 16 additions and 13 deletions

View File

@ -175,13 +175,16 @@ class HotPackage(package_base.PackageBase):
@staticmethod
def _translate_outputs(hot):
result = {}
for key in (hot.get('outputs') or {}).keys():
result[key] = {
"Contract": YAQL("$.string()"),
"Usage": "Out"
contract = {}
for key in (hot.get('outputs') or {}).iterkeys():
contract[key] = YAQL("$.string()")
return {
'templateOutputs': {
'Contract': contract,
'Default': {},
'Usage': 'Out'
}
return result
}
@staticmethod
def _translate_files(source_directory):
@ -262,10 +265,6 @@ class HotPackage(package_base.PackageBase):
hot_env = YAQL("$.hotEnvironment")
copy_outputs = []
for key in (hot.get('outputs') or {}).keys():
copy_outputs.append({YAQL('$.' + key): YAQL('$outputs.' + key)})
deploy = [
{YAQL('$environment'): YAQL(
"$.find('io.murano.Environment').require()"
@ -320,8 +319,7 @@ class HotPackage(package_base.PackageBase):
}
],
'Else': [
{YAQL('$outputs'): YAQL('$stack.output()')},
{'Do': copy_outputs},
{YAQL('$.templateOutputs'): YAQL('$stack.output()')},
YAQL("$reporter.report($this, "
"'Stack was successfully created')"),
@ -340,7 +338,7 @@ class HotPackage(package_base.PackageBase):
]
return {
'Workflow': {
'Methods': {
'deploy': {
'Body': deploy
},

View File

@ -0,0 +1,5 @@
---
features:
- All HOT template outputs are put into a single dictionary property
'templateOutputs' rather than in a generated property per each output.
As a result there are no more constraints on output names.