From d5f3dbe0a5ff87a619bec9a99c0618f90f781659 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 20 Oct 2015 14:14:08 -0200 Subject: Fix variable deprecations on templates --- templates/backupninja.conf.erb | 22 ++++++++-------- templates/backupninja.cron.erb | 2 +- templates/dup.conf.erb | 60 +++++++++++++++++++++--------------------- templates/labelmount.conf.erb | 4 +-- templates/maildir.conf.erb | 6 ++--- templates/mysql.conf.erb | 20 +++++++------- templates/pgsql.conf.erb | 18 ++++++------- templates/rdiff.conf.erb | 32 +++++++++++----------- templates/rsync.conf.erb | 14 +++++----- templates/sh.conf.erb | 2 +- templates/svn.conf.erb | 4 +-- templates/sys.conf.erb | 16 +++++------ templates/umount.conf.erb | 2 +- 13 files changed, 101 insertions(+), 101 deletions(-) diff --git a/templates/backupninja.conf.erb b/templates/backupninja.conf.erb index fe7affa..20cc9b3 100644 --- a/templates/backupninja.conf.erb +++ b/templates/backupninja.conf.erb @@ -3,11 +3,11 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -loglevel = <%= loglvl %> -when = <%= send(:when) %> -reportemail = <%= reportemail %> -reportsuccess = <%= reportsuccess ? 'yes' : 'no' %> -reportwarning = <%= reportwarning ? 'yes' : 'no' %> +loglevel = <%= @loglvl %> +when = <%= send(:@when) %> +reportemail = <%= @reportemail %> +reportsuccess = <%= @reportsuccess ? 'yes' : 'no' %> +reportwarning = <%= @reportwarning ? 'yes' : 'no' %> <% if @reporthost -%> <%= 'reporthost = ' + @reporthost %> <% end -%> @@ -17,9 +17,9 @@ reportwarning = <%= reportwarning ? 'yes' : 'no' %> <% if @reportdirectory -%> <%= 'reportdirectory = ' + @reportdirectory %> <% end -%> -logfile = <%= logfile %> -configdirectory = <%= configdir %> -scriptdirectory = <%= scriptdir %> -libdirectory = <%= libdir %> -usecolors = <%= usecolors ? 'yes' : 'no' %> -vservers = <%= vservers ? 'yes' : 'no' %> +logfile = <%= @logfile %> +configdirectory = <%= @configdir %> +scriptdirectory = <%= @scriptdir %> +libdirectory = <%= @libdir %> +usecolors = <%= @usecolors ? 'yes' : 'no' %> +vservers = <%= @vservers ? 'yes' : 'no' %> diff --git a/templates/backupninja.cron.erb b/templates/backupninja.cron.erb index ec392ca..3355d82 100644 --- a/templates/backupninja.cron.erb +++ b/templates/backupninja.cron.erb @@ -3,4 +3,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # # run backupninja -<%= min %> <%= hour %> <%= dom %> <%= month %> <%= dow %> root if [ -x <%= backupninja_test_cmd %> ]; then <%= backupninja_cmd %>; fi +<%= @min %> <%= @hour %> <%= @dom %> <%= @month %> <%= @dow %> root if [ -x <%= @backupninja_test_cmd %> ]; then <%= @backupninja_cmd %>; fi diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb index 4f15e78..533bb74 100644 --- a/templates/dup.conf.erb +++ b/templates/dup.conf.erb @@ -3,44 +3,44 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<%= 'options = ' + options if options %> -<%= 'nicelevel = ' + nicelevel if nicelevel %> -<%= 'testconnect = ' + testconnect if testconnect %> -<%= 'tmpdir = ' + tmpdir if tmpdir %> +<%= 'options = ' + @options if @options %> +<%= 'nicelevel = ' + @nicelevel if @nicelevel %> +<%= 'testconnect = ' + @testconnect if @testconnect %> +<%= 'tmpdir = ' + @tmpdir if @tmpdir %> [gpg] -<%= 'sign = ' + sign if sign %> -<%= 'encryptkey = ' + encryptkey if encryptkey %> -<%= 'signkey = ' + signkey if signkey %> -<%= 'password = ' + password if password %> +<%= 'sign = ' + @sign if @sign %> +<%= 'encryptkey = ' + @encryptkey if @encryptkey %> +<%= 'signkey = ' + @signkey if @signkey %> +<%= 'password = ' + @password if @password %> [source] -<% if include.is_a? String -%> -<%= 'include = ' + include %> -<% elsif include.is_a? Array -%> -<%= include.map { |i| "include = #{i}" }.join("\n") %> +<% if @include.is_a? String -%> +<%= 'include = ' + @include %> +<% elsif @include.is_a? Array -%> +<%= @include.map { |i| "include = #{i}" }.join("\n") %> <% end -%> -<% if exclude.is_a? String -%> -<%= 'exclude = ' + exclude %> -<% elsif exclude.is_a? Array -%> -<%= exclude.map { |i| "exclude = #{i}" }.join("\n") %> +<% if @exclude.is_a? String -%> +<%= 'exclude = ' + @exclude %> +<% elsif @exclude.is_a? Array -%> +<%= @exclude.map { |i| "exclude = #{i}" }.join("\n") %> <% end -%> -<% if vsinclude.is_a? String -%> -<%= 'vsinclude = ' + vsinclude %> -<% elsif vsinclude.is_a? Array -%> -<%= vsinclude.map { |i| "vsinclude = #{i}" }.join("\n") %> +<% if @vsinclude.is_a? String -%> +<%= 'vsinclude = ' + @vsinclude %> +<% elsif @vsinclude.is_a? Array -%> +<%= @vsinclude.map { |i| "vsinclude = #{i}" }.join("\n") %> <% end -%> [dest] -<%= 'incremental = ' + incremental if incremental %> -<%= 'increments = ' + increments if increments %> -<%= 'keep = ' + keep if keep %> -<%= 'keepincroffulls = ' + keepincroffulls if keepincroffulls %> -<%= 'bandwidthlimit = ' + bandwidthlimit if bandwidthlimit %> -<%= 'sshoptions = ' + sshoptions if sshoptions %> -<%= 'destdir = ' + destdir if destdir %> -<%= 'desthost = ' + desthost if desthost %> -<%= 'destuser = ' + destuser if destuser %> -<%= 'desturl = ' + desturl if desturl %> +<%= 'incremental = ' + @incremental if @incremental %> +<%= 'increments = ' + @increments if @increments %> +<%= 'keep = ' + @keep if @keep %> +<%= 'keepincroffulls = ' + @keepincroffulls if @keepincroffulls %> +<%= 'bandwidthlimit = ' + @bandwidthlimit if @bandwidthlimit %> +<%= 'sshoptions = ' + @sshoptions if @sshoptions %> +<%= 'destdir = ' + @destdir if @destdir %> +<%= 'desthost = ' + @desthost if @desthost %> +<%= 'destuser = ' + @destuser if @destuser %> +<%= 'desturl = ' + @desturl if @desturl %> diff --git a/templates/labelmount.conf.erb b/templates/labelmount.conf.erb index e40c49d..b205bb3 100644 --- a/templates/labelmount.conf.erb +++ b/templates/labelmount.conf.erb @@ -1,2 +1,2 @@ -label = <%= label %> -dest = <%= dest %> +label = <%= @label %> +dest = <%= @dest %> diff --git a/templates/maildir.conf.erb b/templates/maildir.conf.erb index 351f382..7f454a3 100644 --- a/templates/maildir.conf.erb +++ b/templates/maildir.conf.erb @@ -3,12 +3,12 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<% %w{when srcdir destdir desthost destuser destid_file keepdaily keepweekly keepmonthly}.each do |v| +<% %w{@when @srcdir @destdir @desthost @destuser @destid_file @keepdaily @keepweekly @keepmonthly}.each do |v| if send(v) -%><%= v + ' = ' + send(v) + "\n" %><% end end -%> -remove = <%= remove ? 'yes' : 'no' %> -multiconnection = <%= multiconnection ? 'yes' : 'no' %> +remove = <%= @remove ? 'yes' : 'no' %> +multiconnection = <%= @multiconnection ? 'yes' : 'no' %> diff --git a/templates/mysql.conf.erb b/templates/mysql.conf.erb index b7ac5e8..cb4617d 100644 --- a/templates/mysql.conf.erb +++ b/templates/mysql.conf.erb @@ -3,23 +3,23 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<% %w{user dbusername dbpassword dbhost databases backupdir vsname sqldumpoptions}.each do |v| +<% %w{@user @dbusername @dbpassword @dbhost @databases @backupdir @vsname @sqldumpoptions}.each do |v| if send(v) -%><%= v + ' = ' + send(v) + "\n" %><% end end -%> -hotcopy = <%= hotcopy ? 'yes' : 'no' %> -sqldump = <%= sqldump ? 'yes' : 'no' %> -compress = <%= compress ? 'yes' : 'no' %> +hotcopy = <%= @hotcopy ? 'yes' : 'no' %> +sqldump = <%= @sqldump ? 'yes' : 'no' %> +compress = <%= @compress ? 'yes' : 'no' %> -<% if real_configfile %> -configfile = <%= real_configfile %> +<% if @real_configfile %> +configfile = <%= @real_configfile %> <% end %> -<% if nodata.is_a? String -%> -<%= 'nodata = ' + nodata %> -<% elsif nodata.is_a? Array -%> -<%= "nodata = " + nodata.map { |i| "#{i}" }.join(" ") %> +<% if @nodata.is_a? String -%> +<%= 'nodata = ' + @nodata %> +<% elsif @nodata.is_a? Array -%> +<%= "nodata = " + @nodata.map { |i| "#{i}" }.join(" ") %> <% end -%> diff --git a/templates/pgsql.conf.erb b/templates/pgsql.conf.erb index 5ffa89c..e75f7d6 100644 --- a/templates/pgsql.conf.erb +++ b/templates/pgsql.conf.erb @@ -1,13 +1,13 @@ -<% if vsname %> -vsname = <%= vsname %> +<% if @vsname %> +vsname = <%= @vsname %> <% end %> -<% if backupdir %> -backupdir = <%= backupdir %> +<% if @backupdir %> +backupdir = <%= @backupdir %> <% end %> -<% if databases.is_a? String -%> -<%= 'databases = ' + databases %> -<% elsif databases.is_a? Array -%> -<%= "databases = " + databases.map { |i| "#{i}" }.join(" ") %> +<% if @databases.is_a? String -%> +<%= 'databases = ' + @databases %> +<% elsif @databases.is_a? Array -%> +<%= "databases = " + @databases.map { |i| "#{i}" }.join(" ") %> <% end -%> -compress = <%= compress ? 'yes' : 'no' %> +compress = <%= @compress ? 'yes' : 'no' %> diff --git a/templates/rdiff.conf.erb b/templates/rdiff.conf.erb index 23c336f..ca812ba 100644 --- a/templates/rdiff.conf.erb +++ b/templates/rdiff.conf.erb @@ -3,34 +3,34 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<%= 'options = ' + options if options %> +<%= 'options = ' + @options if @options %> -<%= extras if extras %> +<%= @extras if @extras %> [source] type = local -<%= 'keep = ' + keep if keep %> +<%= 'keep = ' + @keep if @keep %> -<% if include.is_a? String -%> -<%= 'include = ' + include %> -<% elsif include.is_a? Array -%> -<%= include.map { |i| "include = #{i}" }.join("\n") %> +<% if @include.is_a? String -%> +<%= 'include = ' + @include %> +<% elsif @include.is_a? Array -%> +<%= @include.map { |i| "include = #{i}" }.join("\n") %> <% end -%> -<% if exclude.is_a? String -%> -<%= 'exclude = ' + exclude %> -<% elsif exclude.is_a? Array -%> -<%= exclude.map { |i| "exclude = #{i}" }.join("\n") %> +<% if @exclude.is_a? String -%> +<%= 'exclude = ' + @exclude %> +<% elsif @exclude.is_a? Array -%> +<%= @exclude.map { |i| "exclude = #{i}" }.join("\n") %> <% end -%> -<% if vsinclude.is_a? String -%> -<%= 'vsinclude = ' + vsinclude %> -<% elsif vsinclude.is_a? Array -%> -<%= vsinclude.map { |i| "vsinclude = #{i}" }.join("\n") %> +<% if @vsinclude.is_a? String -%> +<%= 'vsinclude = ' + @vsinclude %> +<% elsif @vsinclude.is_a? Array -%> +<%= @vsinclude.map { |i| "vsinclude = #{i}" }.join("\n") %> <% end -%> [dest] -<%- %w{type host directory user sshoptions}.each do |v| +<%- %w{@type @host @directory @user @sshoptions}.each do |v| if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> <%- diff --git a/templates/rsync.conf.erb b/templates/rsync.conf.erb index 778676f..5ed4acb 100644 --- a/templates/rsync.conf.erb +++ b/templates/rsync.conf.erb @@ -4,7 +4,7 @@ # service in Puppet. [general] -<%- %w{log partition fscheck read_only mountpoint backupdir format days keepdaily keepweekly keepmonthly lockfile nicelevel enable_mv_timestamp_bug, tmp, multiconnection}.each do |v| +<%- %w{@log @partition @fscheck @read_only @mountpoint @backupdir @format @days @keepdaily @keepweekly @keepmonthly @lockfile @nicelevel @enable_mv_timestamp_bug, @tmp, @multiconnection}.each do |v| if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> <%- @@ -12,10 +12,10 @@ end -%> [source] -<% unless from.empty? and from.to_s != "false" -%> -from = <%= from %> +<% unless @from.empty? and @from.to_s != "false" -%> +from = <%= f@rom %> <% end -%> -<%- %w{include exclude}.each do |v| +<%- %w{@include exclude}.each do |v| if has_variable?(v) instance_variable_get("@#{v}").to_a.each do |parameter| -%> <%= v + ' = ' + parameter %> @@ -25,7 +25,7 @@ from = <%= from %> end -%> [dest] -<%- %w{dest testconnect ssh protocol numericids compress host port user id_file bandwidthlimit remote_rsync batch batchbase fakesuper}.each do |v| +<%- %w{@dest @testconnect @ssh @protocol @numericids @compress @host @port @user @id_file @bandwidthlimit @remote_rsync @batch @batchbase @fakesuper}.each do |v| if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> <%- @@ -33,7 +33,7 @@ end -%> end -%> [services] -<%- %w{initscripts service}.each do |v| +<%- %w{@initscripts service}.each do |v| if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> <%- @@ -41,7 +41,7 @@ end -%> end -%> [system] -<%- %w{rm cp touch mv fsck}.each do |v| +<%- %w{@rm @cp @touch @mv @fsck}.each do |v| if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> <%- diff --git a/templates/sh.conf.erb b/templates/sh.conf.erb index f1e77ff..e0e5137 100644 --- a/templates/sh.conf.erb +++ b/templates/sh.conf.erb @@ -5,6 +5,6 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<% command_string.each do |line| -%> +<% @command_string.each do |line| -%> <%= line %> <% end -%> diff --git a/templates/svn.conf.erb b/templates/svn.conf.erb index 465cc67..19417af 100644 --- a/templates/svn.conf.erb +++ b/templates/svn.conf.erb @@ -3,8 +3,8 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<% %w{src dest tmp vsname}.each do |v| +<% %w{@src @dest @tmp @vsname}.each do |v| if send(v) -%><%= v + ' = ' + send(v) + "\n" %><% end -end -%> \ No newline at end of file +end -%> diff --git a/templates/sys.conf.erb b/templates/sys.conf.erb index a684e8b..84297d3 100644 --- a/templates/sys.conf.erb +++ b/templates/sys.conf.erb @@ -3,16 +3,16 @@ # the next time Puppet runs. Please make configuration changes to this # service in Puppet. -<% %w{parentdir packagesfile partitionsfile hardwarefile}.each do |v| +<% %w{@parentdir @packagesfile @partitionsfile @hardwarefile}.each do |v| if send(v) -%><%= v + ' = ' + send(v) + "\n" %><% end end -%> -packages = <%= packages ? 'yes' : 'no' %> -partitions = <%= partitions ? 'yes' : 'no' %> -dosfdisk = <%= dosfdisk ? 'yes' : 'no' %> -hardware = <%= hardware ? 'yes' : 'no' %> -dohwinfo = <%= dohwinfo ? 'yes' : 'no' %> -luksheaders = <%= doluks ? 'yes' : 'no' %> -lvm = <%= dolvm ? 'yes' : 'no' %> +packages = <%= @packages ? 'yes' : 'no' %> +partitions = <%= @partitions ? 'yes' : 'no' %> +dosfdisk = <%= @dosfdisk ? 'yes' : 'no' %> +hardware = <%= @hardware ? 'yes' : 'no' %> +dohwinfo = <%= @dohwinfo ? 'yes' : 'no' %> +luksheaders = <%= @doluks ? 'yes' : 'no' %> +lvm = <%= @dolvm ? 'yes' : 'no' %> diff --git a/templates/umount.conf.erb b/templates/umount.conf.erb index 59bfaec..1e59c36 100644 --- a/templates/umount.conf.erb +++ b/templates/umount.conf.erb @@ -1 +1 @@ -dir = <%= dest %> +dir = <%= @dest %> -- cgit v1.2.3