Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
fix warning for 'backup_client'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Neff committed Sep 29, 2015
1 parent a096dcd commit ac8f105
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@
default['stash']['backup']['cron']['weekday'] = '*'

default['stash']['backup_client']['install_path'] = node['stash']['install_path']
default['stash']['backup_client']['password'] = 'changeit'
default['stash']['backup_client']['user'] = 'admin'
default['stash']['backup_client']['version'] = '2.0.0'
stash_backup_client_version = Chef::Version.new(node['stash']['backup_client']['version'])

Expand Down
8 changes: 5 additions & 3 deletions libraries/stash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ def self.default_database_port(type)

def self.check_for_old_attributes!(node)
backup_attrs = %w(backup_path baseurl password user cron)
show_warn = false
backup_attrs.each do |attr|
unless node['stash']['backup_client'][attr].nil?
node.default['stash']['backup_client'][attr] = node['stash']['backup'][attr]
node.default['stash']['backup'][attr] = node['stash']['backup_client'][attr]
Chef::Log.warn "node['stash']['backup_client']['#{attr}'] has been changed to node['stash']['backup']['#{attr}']"
show_warn = true
end
end
Chef::Log.warn <<-EOH
Chef::Log.warn <<-EOH if show_warn
This renaming introduces the common approach for both of backup strategies:
'backup_client' and 'backup_diy'. Attributes metioned above will be gracefully
'backup_client' and 'backup_diy'. Attributes mentioned above will be gracefully
converted for you, but this warning and conversion will be removed in the next
major release of the 'stash' cookbook.
EOH
Expand Down

0 comments on commit ac8f105

Please sign in to comment.