From 9e37efea4c185f36eda26226c4979f3c6d1aeed7 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 10 Aug 2015 17:37:59 -0700 Subject: [PATCH] Fix variables in nodepool.default.erb template Since all the variables accessed in this template are within the current scope, there is no need to use scope.lookupvar here. Using it adds complications, especially when passing undefined values. This patch removes unnecessary uses of scope.lookupvar and replaces them with instance variables. This patch leaves the vhost template alone since the template is not evaluated in the same scope. The nodepool.logging.conf template was already properly using scoped instance variables. Change-Id: Ie7d0a45905103c81d0c1822d89e2731e7395a3e3 --- templates/nodepool.default.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/nodepool.default.erb b/templates/nodepool.default.erb index a0be88d..005053c 100644 --- a/templates/nodepool.default.erb +++ b/templates/nodepool.default.erb @@ -1,8 +1,8 @@ -<% if scope.lookupvar("nodepool::statsd_host") != "" -%> -export STATSD_HOST=<%= scope.lookupvar("nodepool::statsd_host") %> +<% if @statsd_host != "" -%> +export STATSD_HOST=<%= @statsd_host %> export STATSD_PORT=8125 <% end -%> -<% scope.lookupvar("nodepool::environment").keys.sort.each do |key| -%> -export <%= key %>='<%= scope.lookupvar("nodepool::environment")[key] %>' +<% @environment.keys.sort.each do |key| -%> +export <%= key %>='<%= @environment[key] %>' <% end -%> DAEMON_ARGS="-c /etc/nodepool/nodepool.yaml -l /etc/nodepool/logging.conf"