Skip to content

Commit

Permalink
Added a test to see if the lookup variables megaraid_device and megar…
Browse files Browse the repository at this point in the history
…aid_drive are :undefined

When running without megaraid devices puppet throws an error about being unable
to split on :undefined:Symbol so we should test if its undefined and not attempt
the split
  • Loading branch information
acr31 committed May 15, 2013
1 parent e02f06c commit 3463290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/smartd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ DEFAULT -m <%= @mail_to %> -M <%= @warning_schedule %>
<% megaraid_adapters = scope.lookupvar('::megaraid_adapters')
megaraid_device = scope.lookupvar('::megaraid_virtual_drives')
megaraid_drives = scope.lookupvar('::megaraid_physical_drives')
megaraid_device = megaraid_device.split(/,/)[0]
megaraid_drives = megaraid_drives.nil? ? [] : megaraid_drives.split(/,/)
megaraid_device = megaraid_device == :undefined ? "" : megaraid_device.split(/,/)[0]
megaraid_drives = megaraid_drives == :undefined ? [] : megaraid_drives.split(/,/)

if megaraid_device and megaraid_device != '' and
megaraid_adapters and megaraid_adapters.to_i > 0 -%>
Expand Down

0 comments on commit 3463290

Please sign in to comment.