diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e813e2b..f4a4e9b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,5 @@ +0.19.10: + - TF error messages are unhelpful if Terraform binary does not exist 0.19.9: - Fix the tfvars flag for older tfsec versions 0.19.8: diff --git a/cloudify_tf/utils.py b/cloudify_tf/utils.py index 68d42e0..c262b29 100644 --- a/cloudify_tf/utils.py +++ b/cloudify_tf/utils.py @@ -258,19 +258,26 @@ def is_using_existing(target=True): def get_binary_location_from_rel(): - tf_rel = find_terraform_node_from_rel() - terraform_config = tf_rel.target.node.properties.get( - 'terraform_config', {}) - candidate_a = terraform_config.get('executable_path') candidate_b = get_executable_path() if candidate_b and os.path.isfile(candidate_b): + ctx.logger.debug( + 'Executable path from node {}'.format(candidate_b)) return candidate_b - if candidate_a and os.path.isfile(candidate_a): - return candidate_a + tf_rel = find_terraform_node_from_rel() + if tf_rel: + terraform_config = tf_rel.target.node.properties.get( + 'terraform_config', {}) + candidate_a = terraform_config.get('executable_path') + if candidate_a and os.path.isfile(candidate_a): + ctx.logger.debug( + 'Executable path from rel {}'.format(candidate_a)) + return candidate_a raise NonRecoverableError( - "Terraform's executable not found in {0} or {1}. Please set the " - "'executable_path' property accordingly.".format( - candidate_b, candidate_a)) + "Terraform's executable not found from relationship " + "'cloudify.terraform.relationships.run_on_host' to type " + "'cloudify.nodes.terraform' or by setting the value in " + "'terraform_config'. Please set the 'executable_path' property " + "accordingly.") def find_terraform_node_from_rel(): diff --git a/plugin.yaml b/plugin.yaml index eeebf7b..a76cf5a 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -2,7 +2,7 @@ plugins: tf: executor: central_deployment_agent package_name: cloudify-terraform-plugin - package_version: '0.19.9' + package_version: '0.19.10' dsl_definitions: diff --git a/plugin_1_4.yaml b/plugin_1_4.yaml index f5c5af8..a8f2835 100644 --- a/plugin_1_4.yaml +++ b/plugin_1_4.yaml @@ -2,7 +2,7 @@ plugins: tf: executor: central_deployment_agent package_name: cloudify-terraform-plugin - package_version: '0.19.9' + package_version: '0.19.10' dsl_definitions: diff --git a/v2_plugin.yaml b/v2_plugin.yaml index d525013..85bff71 100644 --- a/v2_plugin.yaml +++ b/v2_plugin.yaml @@ -2,7 +2,7 @@ plugins: tf: executor: central_deployment_agent package_name: cloudify-terraform-plugin - package_version: '0.19.9' + package_version: '0.19.10' dsl_definitions: