Make foodcritic and rubocop happy again
This commit is contained in:
parent
2b91f3513f
commit
0c0580f7e5
1
Gemfile
1
Gemfile
@ -3,7 +3,6 @@ source 'https://rubygems.org'
|
|||||||
group :lint do
|
group :lint do
|
||||||
gem 'foodcritic', '~> 4.0'
|
gem 'foodcritic', '~> 4.0'
|
||||||
gem 'rubocop', '~> 0.33'
|
gem 'rubocop', '~> 0.33'
|
||||||
gem 'rake'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :unit do
|
group :unit do
|
||||||
|
@ -16,32 +16,29 @@
|
|||||||
|
|
||||||
node['postfix']['maps'].each do |type, maps|
|
node['postfix']['maps'].each do |type, maps|
|
||||||
if node['platform_family'] == 'debian'
|
if node['platform_family'] == 'debian'
|
||||||
if ['pgsql', 'mysql', 'ldap', 'cdb'].include?(type)
|
package "postfix-#{type}" if %w(pgsql mysql ldap cdb).include?(type)
|
||||||
package "postfix-#{type}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if %w(pgsql mysql ldap memcache sqlite).include?(type)
|
||||||
|
separator = ' = '
|
||||||
|
else
|
||||||
|
separator = ' '
|
||||||
|
end
|
||||||
maps.each do |file, content|
|
maps.each do |file, content|
|
||||||
if ['btree', 'cdb', 'dbm', 'hash', 'sdbm'].include?(type)
|
execute "update-postmap-#{file}" do
|
||||||
execute "update-postmap-#{file}" do
|
command "postmap #{file}"
|
||||||
command "postmap #{file}"
|
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
|
||||||
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
|
action :nothing
|
||||||
action :nothing
|
end if %w(btree cdb dbm hash sdbm).include?(type)
|
||||||
end
|
template "#{file}-#{type}" do
|
||||||
end
|
path file
|
||||||
if ['pgsql', 'mysql', 'ldap', 'memcache', 'sqlite'].include?(type)
|
|
||||||
separator = " = "
|
|
||||||
else
|
|
||||||
separator = " "
|
|
||||||
end
|
|
||||||
template file do
|
|
||||||
source 'maps.erb'
|
source 'maps.erb'
|
||||||
only_if "postconf -m | grep -q #{type}"
|
only_if "postconf -m | grep -q #{type}"
|
||||||
variables(
|
variables(
|
||||||
map: content,
|
map: content,
|
||||||
separator: separator
|
separator: separator
|
||||||
)
|
)
|
||||||
if ['btree', 'cdb', 'dbm', 'hash', 'sdbm'].include?(type)
|
if %w(btree cdb dbm hash sdbm).include?(type)
|
||||||
notifies :run, "execute[update-postmap-#{file}]"
|
notifies :run, "execute[update-postmap-#{file}]"
|
||||||
end
|
end
|
||||||
notifies :restart, 'service[postfix]'
|
notifies :restart, 'service[postfix]'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user