Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use foodcritic 5.0.0 #215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

group :lint do
gem 'foodcritic', '~> 4.0'
gem 'foodcritic', '~> 5.0'
gem 'rubocop', '~> 0.33'
end

Expand Down
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace :style do
FoodCritic::Rake::LintTask.new(:chef) do |t|
t.options = {
fail_tags: ['any'],
tags: ['~FC003'],
chef_version: '11.6.0'
tags: ['~FC003']
}
end
rescue LoadError
Expand Down
4 changes: 2 additions & 2 deletions providers/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def whyrun_supported?
key = @new_resource.key || get_key(keyname)

# update the key in the file
file filename do # ~FC009
file filename do
content file_content(keyname, key, as_keyring)
owner owner
group group
Expand Down Expand Up @@ -111,7 +111,7 @@ def create_entity(keyname)
Chef::Log.debug "Client #{keyname} created"

# remove temporary keyring file
file tmp_keyring do # ~FC009
file tmp_keyring do
action :delete
sensitive true if Chef::Resource::File.method_defined? :sensitive
end
Expand Down
4 changes: 2 additions & 2 deletions recipes/mon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@

keyring = "#{Chef::Config[:file_cache_path]}/#{cluster}-#{node['hostname']}.mon.keyring"

execute 'format mon-secret as keyring' do # ~FC009
execute 'format mon-secret as keyring' do
command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" }
creates keyring
only_if { mon_secret }
sensitive true if Chef::Resource::Execute.method_defined? :sensitive
end

execute 'generate mon-secret as keyring' do # ~FC009
execute 'generate mon-secret as keyring' do
command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'"
creates keyring
not_if { mon_secret }
Expand Down
2 changes: 1 addition & 1 deletion recipes/osd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# TODO: cluster name
cluster = 'ceph'

execute 'format bootstrap-osd as keyring' do # ~FC009
execute 'format bootstrap-osd as keyring' do
command lazy { "ceph-authtool '/var/lib/ceph/bootstrap-osd/#{cluster}.keyring' --create-keyring --name=client.bootstrap-osd --add-key='#{osd_secret}'" }
creates "/var/lib/ceph/bootstrap-osd/#{cluster}.keyring"
only_if { osd_secret }
Expand Down