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
$pw_save_file = $tsmclient::siteconfig::password_save_location
if $pw_save_file {
$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)
}
......
......@@ -7,14 +7,14 @@ mandatory = {
}
options = { }
tsm_optoptions.each do |opt|
@tsm_optoptions.each do |opt|
name,value = opt.strip.split(nil, 2)
name = name.strip.downcase
value = (value or "").strip
if (mandatory.has_key?(name) or name =~ /^(include|exclude)([.].*)?$/ or
name == "servername" or name == "nodename")
raise(Puppet::ParseError,
("Tsm_client[#{tsm_servername}]: " +
("Tsm_client[#{@tsm_servername}]: " +
"Illegal TSM optoption ``#{opt}''"))
end
options[name] = value
......@@ -22,7 +22,7 @@ end
options.merge!(mandatory)
-%>
SERVERNAME <%= tsm_servername.upcase %>
SERVERNAME <%= @tsm_servername.upcase %>
<% options.keys.sort.each do |optname| -%>
<%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %>
<% end %>
......@@ -6,20 +6,20 @@
mandatory = {
# The tsm_client define expects these to be set this way
'commmethod' => "tcpip",
'tcpserveraddress' => tsm_serveraddress,
'passworddir' => "#{tsmpassworddir}/",
'inclexcl' => "#{tsmdir}/bin/include_exclude.#{tsm_servername}",
'tcpserveraddress' => @tsm_serveraddress,
'passworddir' => "#{@tsmpassworddir}/",
'inclexcl' => "#{@tsmdir}/bin/include_exclude.#{@tsm_servername}",
}
options = { }
tsm_sysoptions.each do |opt|
@tsm_sysoptions.each do |opt|
name,value = opt.strip.split(nil, 2)
name = name.strip.downcase
value = (value or "").strip
if (mandatory.has_key?(name) or name =~ /^(include|exclude)([.].*)?$/ or
name == "servername" or name == "nodename")
raise(Puppet::ParseError,
("Tsm_client[#{tsm_servername}]: " +
("Tsm_client[#{@tsm_servername}]: " +
"Illegal TSM sysoption ``#{opt}''"))
end
options[name] = value
......@@ -27,8 +27,8 @@ end
options.merge!(mandatory)
-%>
SERVERNAME <%= tsm_servername.upcase %>
NODENAME <%= tsm_nodename %>
SERVERNAME <%= @tsm_servername.upcase %>
NODENAME <%= @tsm_nodename %>
<% options.keys.sort.each do |optname| -%>
<%= sprintf("%-24s %s", optname.to_s, options[optname]).strip %>
<% end %>
......@@ -3,11 +3,11 @@
# 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)
if path == nil
raise(Puppet::ParseError,
"Tsm_client[#{tsm_servername}]: Bad inclexcl line #{directive}")
"Tsm_client[#{@tsm_servername}]: Bad inclexcl line #{directive}")
end
type.strip!
path.strip!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment