Improved error reporting for HOT applications
Report HOT deployment errors on behalf of failed application Change-Id: I1eb3f6979c162657298fd0917dcda24a71e56df8 Closes-Bug: #1452080
This commit is contained in:
parent
2affdd5d7a
commit
1fb35e964d
@ -203,6 +203,10 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
|
||||
for key, value in (hot.get('parameters') or {}).items():
|
||||
template_parameters[key] = YAQL("$." + key)
|
||||
|
||||
copy_outputs = []
|
||||
for key, value in (hot.get('outputs') or {}).items():
|
||||
copy_outputs.append({YAQL('$.' + key): YAQL('$outputs.' + key)})
|
||||
|
||||
deploy = [
|
||||
{YAQL('$environment'): YAQL(
|
||||
"$.find('io.murano.Environment').require()"
|
||||
@ -232,17 +236,28 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
|
||||
|
||||
YAQL("$reporter.report($this, "
|
||||
"'Stack creation has started')"),
|
||||
YAQL('$stack.push()'),
|
||||
{YAQL('$outputs'): YAQL('$stack.output()')},
|
||||
YAQL("$reporter.report($this, "
|
||||
"'Stack was successfully created')"),
|
||||
{
|
||||
'Try': [YAQL('$stack.push()')],
|
||||
'Catch': [
|
||||
{
|
||||
'As': 'e',
|
||||
'Do': [
|
||||
YAQL("$reporter.report_error($this, $e.message)"),
|
||||
{'Rethrow': None}
|
||||
]
|
||||
}
|
||||
],
|
||||
'Else': [
|
||||
{YAQL('$outputs'): YAQL('$stack.output()')},
|
||||
{'Do': copy_outputs},
|
||||
YAQL("$reporter.report($this, "
|
||||
"'Stack was successfully created')"),
|
||||
|
||||
YAQL("$reporter.report($this, "
|
||||
"'Application deployment has finished')"),
|
||||
YAQL("$reporter.report($this, "
|
||||
"'Application deployment has finished')"),
|
||||
]
|
||||
}
|
||||
]
|
||||
for key, value in (hot.get('outputs') or {}).items():
|
||||
deploy.append({YAQL('$.' + key): YAQL(
|
||||
'$outputs.' + key)})
|
||||
|
||||
destroy = [
|
||||
{YAQL('$stack'): YAQL(
|
||||
|
Loading…
Reference in New Issue
Block a user