Skip to content
Snippets Groups Projects
Commit ffdae9e2 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Use '@var' syntax consistently in ERB templates.

This is the preferred style in ERB templates, as it makes it clearer
where the variables come from, and avoids shadowing by the templating
internals (e.g. 'memory' and 'file' are shadowed).  Also, in newer
versions of Puppet, it is the way you *must* do it.
parent ded9a13f
No related branches found
No related tags found
No related merge requests found
...@@ -363,7 +363,7 @@ class tsmclient::install ...@@ -363,7 +363,7 @@ class tsmclient::install
$pw_save_file = $tsmclient::siteconfig::password_save_location $pw_save_file = $tsmclient::siteconfig::password_save_location
if $pw_save_file { if $pw_save_file {
$pw_vsave_file = inline_template( $pw_vsave_file = inline_template(
'<%= File.basename(pw_save_file) + ".%Y%m%d-%H%M%S" -%>') '<%= File.basename(@pw_save_file) + ".%Y%m%d-%H%M%S" -%>')
store_versioned_data($tsm_password, $pw_save_file, $pw_vsave_file) store_versioned_data($tsm_password, $pw_save_file, $pw_vsave_file)
} }
......
...@@ -7,14 +7,14 @@ mandatory = { ...@@ -7,14 +7,14 @@ mandatory = {
} }
options = { } options = { }
tsm_optoptions.each do |opt| @tsm_optoptions.each do |opt|
name,value = opt.strip.split(nil, 2) name,value = opt.strip.split(nil, 2)
name = name.strip.downcase name = name.strip.downcase
value = (value or "").strip value = (value or "").strip
if (mandatory.has_key?(name) or name =~ /^(include|exclude)([.].*)?$/ or if (mandatory.has_key?(name) or name =~ /^(include|exclude)([.].*)?$/ or
name == "servername" or name == "nodename") name == "servername" or name == "nodename")
raise(Puppet::ParseError, raise(Puppet::ParseError,
("Tsm_client[#{tsm_servername}]: " + ("Tsm_client[#{@tsm_servername}]: " +
"Illegal TSM optoption ``#{opt}''")) "Illegal TSM optoption ``#{opt}''"))
end end
options[name] = value options[name] = value
...@@ -22,7 +22,7 @@ end ...@@ -22,7 +22,7 @@ end
options.merge!(mandatory) options.merge!(mandatory)
-%> -%>
SERVERNAME <%= tsm_servername.upcase %> SERVERNAME <%= @tsm_servername.upcase %>
<% options.keys.sort.each do |optname| -%> <% options.keys.sort.each do |optname| -%>
<%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %> <%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %>
<% end %> <% end %>
...@@ -6,20 +6,20 @@ ...@@ -6,20 +6,20 @@
mandatory = { mandatory = {
# The tsm_client define expects these to be set this way # The tsm_client define expects these to be set this way
'commmethod' => "tcpip", 'commmethod' => "tcpip",
'tcpserveraddress' => tsm_serveraddress, 'tcpserveraddress' => @tsm_serveraddress,
'passworddir' => "#{tsmpassworddir}/", 'passworddir' => "#{@tsmpassworddir}/",
'inclexcl' => "#{tsmdir}/bin/include_exclude.#{tsm_servername}", 'inclexcl' => "#{@tsmdir}/bin/include_exclude.#{@tsm_servername}",
} }
options = { } options = { }
tsm_sysoptions.each do |opt| @tsm_sysoptions.each do |opt|
name,value = opt.strip.split(nil, 2) name,value = opt.strip.split(nil, 2)
name = name.strip.downcase name = name.strip.downcase
value = (value or "").strip value = (value or "").strip
if (mandatory.has_key?(name) or name =~ /^(include|exclude)([.].*)?$/ or if (mandatory.has_key?(name) or name =~ /^(include|exclude)([.].*)?$/ or
name == "servername" or name == "nodename") name == "servername" or name == "nodename")
raise(Puppet::ParseError, raise(Puppet::ParseError,
("Tsm_client[#{tsm_servername}]: " + ("Tsm_client[#{@tsm_servername}]: " +
"Illegal TSM sysoption ``#{opt}''")) "Illegal TSM sysoption ``#{opt}''"))
end end
options[name] = value options[name] = value
...@@ -27,8 +27,8 @@ end ...@@ -27,8 +27,8 @@ end
options.merge!(mandatory) options.merge!(mandatory)
-%> -%>
SERVERNAME <%= tsm_servername.upcase %> SERVERNAME <%= @tsm_servername.upcase %>
NODENAME <%= tsm_nodename %> NODENAME <%= @tsm_nodename %>
<% options.keys.sort.each do |optname| -%> <% options.keys.sort.each do |optname| -%>
<%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %> <%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %>
<% end %> <% end %>
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
# Licensed under the GNU LGPL v3+; see the README file for more information. # Licensed under the GNU LGPL v3+; see the README file for more information.
tsm_inclexcl.each do |directive| @tsm_inclexcl.each do |directive|
type,path = directive.split(nil, 2) type,path = directive.split(nil, 2)
if path == nil if path == nil
raise(Puppet::ParseError, raise(Puppet::ParseError,
"Tsm_client[#{tsm_servername}]: Bad inclexcl line #{directive}") "Tsm_client[#{@tsm_servername}]: Bad inclexcl line #{directive}")
end end
type.strip! type.strip!
path.strip! path.strip!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment