Skip to content

Commit

Permalink
rename $device_opts to $device_options
Browse files Browse the repository at this point in the history
For naming consistency with $devicescan_options
  • Loading branch information
Joshua Hoblitt committed Sep 14, 2013
1 parent 9c9564c commit 6e9121f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Usage
devicescan => true,
devicescan_options => '-H -m [email protected]',
devices => [ '/dev/sg1', '/dev/sg2' ],
device_opts => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' },
device_options => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' },
mail_to => 'root',
warning_schedule => 'diminishing',
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#
# defaults to: []
#
# [*device_opts*]
# [*device_options*]
# Hash.
#
# List of options to pass to a specific device. Eg.
Expand Down Expand Up @@ -110,7 +110,7 @@
$devicescan = $smartd::params::devicescan,
$devicescan_options = $smartd::params::devicescan_options,
$devices = $smartd::params::devices,
$device_opts = $smartd::params::device_opts,
$device_options = $smartd::params::device_options,
$mail_to = $smartd::params::mail_to,
$warning_schedule = $smartd::params::warning_schedule,
) inherits smartd::params {
Expand All @@ -122,7 +122,7 @@
validate_bool($devicescan)
validate_string($devicescan_options)
validate_array($devices)
validate_hash($device_opts)
validate_hash($device_options)
validate_string($mail_to)
validate_re($warning_schedule, '^daily$|^once$|^diminishing$',
'$warning_schedule must be either daily, once, or diminishing.')
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$devicescan = true
$devicescan_options = undef
$devices = []
$device_opts = {}
$device_options = {}
$mail_to = 'root'
$warning_schedule = 'daily' # other choices: once, diminishing

Expand Down
6 changes: 3 additions & 3 deletions spec/classes/smartd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@
end
end

describe 'device_opts => "{ /dev/sg1 => -o on -S on -a, /dev/sg2 => -o on -S on -a }"' do
describe 'device_options => "{ /dev/sg1 => -o on -S on -a, /dev/sg2 => -o on -S on -a }"' do
let :params do {
:devices => [ '/dev/sg1', '/dev/sg2', ],
:device_opts => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' }
:device_options => { '/dev/sg1' => '-o on -S on -a', '/dev/sg2' => '-o on -S on -a' }
}
end

Expand Down Expand Up @@ -308,7 +308,7 @@
end
let(:params) do
{
:device_opts => { 'megaraid' => '-I 194'},
:device_options => { 'megaraid' => '-I 194'},
}
end

Expand Down
4 changes: 2 additions & 2 deletions templates/smartd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DEFAULT -m <%= @mail_to %> -M <%= @warning_schedule %>
<% @devices.each do |device| -%>
<%= device -%>
<% if @device_opts.has_key?(device) -%> <%= @device_opts[device] %><% end %>
<% if @device_options.has_key?(device) -%> <%= @device_options[device] %><% end %>
<% end -%>
<%
# it doesn't matter which megaraid block device we use to poll as long as all
Expand All @@ -16,7 +16,7 @@ if megaraid_device and megaraid_device != '' and
@megaraid_adapters and @megaraid_adapters.to_i > 0
@megaraid_physical_drives.split(/,/).sort.each do |drive| -%>
<%= megaraid_device %> -d sat+megaraid,<%= drive.to_i -%>
<% if @device_opts.has_key?('megaraid') %> <%= @device_opts['megaraid'] %><% end %>
<% if @device_options.has_key?('megaraid') %> <%= @device_options['megaraid'] %><% end %>
<% end -%>
<% end -%>
<% if @devicescan -%>
Expand Down

0 comments on commit 6e9121f

Please sign in to comment.