Skip to content

Commit

Permalink
remove remaining core foodcritic annotations
Browse files Browse the repository at this point in the history
Differential Revision: D53142318

fbshipit-source-id: 93002dfde1f1c440212a6b453ac4e1552e4e5570
  • Loading branch information
dafyddcrosby authored and facebook-github-bot committed Jan 29, 2024
1 parent 916de38 commit 564dd0f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cookbooks/fb_cron/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
'debian' => '/etc/default/cron',
['rhel', 'fedora'] => '/etc/sysconfig/crond',
)
if envfile # ~FC023
if envfile
template envfile do
source 'crond_env.erb'
owner 'root'
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_cron/recipes/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
package_name = 'cron'
end

if package_name # ~FC023
if package_name
package package_name do
action :upgrade
end
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_launchd/resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def launchd_resource(label, action, attrs = {})
"and attributes #{attrs}",
)
return unless label
res = launchd label do # ~FC022
res = launchd label do
action action.to_sym
if attrs['only_if']
only_if { attrs['only_if'].call }
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/fb_network_scripts/resources/redhat_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def stop(interface)
s.error!
end

action :enable do # ~FC017
action :enable do
requires_full_restart = false
to_converge = []
interface = new_resource.interface
Expand Down Expand Up @@ -326,7 +326,7 @@ def stop(interface)
end
end

action :update_ips do # ~FC017
action :update_ips do
interface = new_resource.interface
if Helpers.will_restart_network?(run_context)
Chef::Log.info("Ignoring #{interface} update_ips, network restart queued")
Expand Down
6 changes: 3 additions & 3 deletions cookbooks/fb_networkd/resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
action :nothing
end

file path do # ~FC022
file path do
only_if { node.interface_change_allowed?(iface) }
action :delete
notifies :run, "execute[networkctl down #{iface}]", :immediately
Expand All @@ -360,7 +360,7 @@
action :nothing
end

file path do # ~FC022
file path do
only_if { node.interface_change_allowed?(iface) }
action :delete
notifies :run, "execute[udevadm trigger #{iface}]"
Expand All @@ -383,7 +383,7 @@
action :nothing
end

file path do # ~FC022
file path do
only_if { node.interface_change_allowed?(iface) }
action :delete
notifies :run, "execute[networkctl delete #{iface}]", :immediately
Expand Down
6 changes: 3 additions & 3 deletions cookbooks/fb_storage/resources/format_devices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
storage.config.each_key do |device|
dev = FB::Storage.device_name_from_path(device)

if node['fb_storage']['tuning']['scheduler'] # ~FC023
if node['fb_storage']['tuning']['scheduler']
fb_sysfs "/sys/block/#{dev}/queue/scheduler" do
# Kernels prior to 4.11 do not have multi-queue support - t19377518
not_if { dev.start_with?('nvme') && !kernel_has_mq }
Expand All @@ -96,14 +96,14 @@
end
end

if node['fb_storage']['tuning']['queue_depth'] # ~FC023
if node['fb_storage']['tuning']['queue_depth']
fb_sysfs "/sys/block/#{dev}/device/queue_depth" do
type :int
value node['fb_storage']['tuning']['queue_depth']
end
end

if node['fb_storage']['tuning']['discard_max_bytes'] # ~FC023
if node['fb_storage']['tuning']['discard_max_bytes']
fname = "/sys/block/#{dev}/device/discard_max_bytes"
fb_sysfs fname do
only_if do
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_swap/recipes/before_fb_fstab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

# Note: FC022 is masked because the unit name is derived from the type
# variable in the loop
service manage_unit do # ~FC022
service manage_unit do
# we can get restarted, but we don't need to enable/start this explicitly
# due to the use of BindsTo on the swap unit
action :nothing
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_sysctl/resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def set_sysctl(node, name, val)
FB::Sysctl.current_settings(node),
node['fb_sysctl'].to_hash,
)
unless bad_settings.empty? # ~FC023
unless bad_settings.empty?
converge_by 'Converging sysctls' do
messages = bad_settings.map do |k, v|
"#{k} (#{v} -> #{node['fb_sysctl'][k]})"
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_system_upgrade/resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

cmd = FB::SystemUpgrade.get_upgrade_command(node)

ruby_block 'actual_dnf_upgrade' do # ~FC014
ruby_block 'actual_dnf_upgrade' do
block do
Chef::Log.info("fb_system_upgrade: Actual upgrade command: #{cmd}")
s = Mixlib::ShellOut.new(
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_systemd/resources/loader_entries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

Dir.glob("#{esp_path}/loader/entries/fb_systemd_*.conf").each do |path|
entry = /^fb_systemd_(\w+)\.conf$/.match(::File.basename(path))
if entry && !entries.include?(entry[1]) # ~FC023
if entry && !entries.include?(entry[1])
file path do
action :delete
end
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/fb_timers/resources/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# We have to do this first cause you can't disable a unit who's file has
# disappeared off the filesystem
possible_link = "/etc/systemd/system/#{fname}"
if ::File.symlink?(possible_link) && # ~FC023
if ::File.symlink?(possible_link) &&
::File.readlink(possible_link) == path
# systemd can get confused if you delete the file without disabling
# the unit first. Disabling a linked unit removes the symlink anyway.
Expand Down

0 comments on commit 564dd0f

Please sign in to comment.