Fix regression in Workflow.groovy
https://mirantis.jira.com/browse/PRODX-7516
Change-Id: I1e836e202b4f0b6ba021f3e304f744a2f985ae6c
diff --git a/src/com/mirantis/mk/Workflow.groovy b/src/com/mirantis/mk/Workflow.groovy
index 0aaa325..92d086e 100644
--- a/src/com/mirantis/mk/Workflow.groovy
+++ b/src/com/mirantis/mk/Workflow.groovy
@@ -113,14 +113,14 @@
'yaml_data': yamls_from_urls[yaml_url]
]
request = "\${yaml_data${yaml_key}}"
-
+ def result
// Catch errors related to wrong key or index in the list or map objects
// For wrong key in map or wrong index in list, groovy returns <null> object,
// but it can be catched only after the string interpolation <template.toString()>,
// so we should catch the string 'null' instead of object <null>.
try {
template = engine.createTemplate(request).make(template_variables)
- def result = template.toString()
+ result = template.toString()
if (result == 'null') {
error "No such key or index, got 'null'"
}