From 564dd0f5451c47a2d5e4b5117b7cfaa920ddd8a7 Mon Sep 17 00:00:00 2001 From: David Crosby Date: Mon, 29 Jan 2024 08:00:09 -0800 Subject: [PATCH] remove remaining core foodcritic annotations Differential Revision: D53142318 fbshipit-source-id: 93002dfde1f1c440212a6b453ac4e1552e4e5570 --- cookbooks/fb_cron/recipes/default.rb | 2 +- cookbooks/fb_cron/recipes/packages.rb | 2 +- cookbooks/fb_launchd/resources/default.rb | 2 +- cookbooks/fb_network_scripts/resources/redhat_interface.rb | 4 ++-- cookbooks/fb_networkd/resources/default.rb | 6 +++--- cookbooks/fb_storage/resources/format_devices.rb | 6 +++--- cookbooks/fb_swap/recipes/before_fb_fstab.rb | 2 +- cookbooks/fb_sysctl/resources/default.rb | 2 +- cookbooks/fb_system_upgrade/resources/default.rb | 2 +- cookbooks/fb_systemd/resources/loader_entries.rb | 2 +- cookbooks/fb_timers/resources/setup.rb | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cookbooks/fb_cron/recipes/default.rb b/cookbooks/fb_cron/recipes/default.rb index 03b4ec334..a831f9b70 100644 --- a/cookbooks/fb_cron/recipes/default.rb +++ b/cookbooks/fb_cron/recipes/default.rb @@ -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' diff --git a/cookbooks/fb_cron/recipes/packages.rb b/cookbooks/fb_cron/recipes/packages.rb index 3b40efdb5..5b236e8f9 100644 --- a/cookbooks/fb_cron/recipes/packages.rb +++ b/cookbooks/fb_cron/recipes/packages.rb @@ -28,7 +28,7 @@ package_name = 'cron' end -if package_name # ~FC023 +if package_name package package_name do action :upgrade end diff --git a/cookbooks/fb_launchd/resources/default.rb b/cookbooks/fb_launchd/resources/default.rb index 821c6c7fe..08e3a7d5e 100644 --- a/cookbooks/fb_launchd/resources/default.rb +++ b/cookbooks/fb_launchd/resources/default.rb @@ -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 } diff --git a/cookbooks/fb_network_scripts/resources/redhat_interface.rb b/cookbooks/fb_network_scripts/resources/redhat_interface.rb index 141fa60e2..1746d32b9 100644 --- a/cookbooks/fb_network_scripts/resources/redhat_interface.rb +++ b/cookbooks/fb_network_scripts/resources/redhat_interface.rb @@ -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 @@ -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") diff --git a/cookbooks/fb_networkd/resources/default.rb b/cookbooks/fb_networkd/resources/default.rb index 49284ee9c..bb6b2ff53 100644 --- a/cookbooks/fb_networkd/resources/default.rb +++ b/cookbooks/fb_networkd/resources/default.rb @@ -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 @@ -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}]" @@ -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 diff --git a/cookbooks/fb_storage/resources/format_devices.rb b/cookbooks/fb_storage/resources/format_devices.rb index 62b1f3afb..a67f30551 100644 --- a/cookbooks/fb_storage/resources/format_devices.rb +++ b/cookbooks/fb_storage/resources/format_devices.rb @@ -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 } @@ -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 diff --git a/cookbooks/fb_swap/recipes/before_fb_fstab.rb b/cookbooks/fb_swap/recipes/before_fb_fstab.rb index 01b976eb8..c9a71f561 100644 --- a/cookbooks/fb_swap/recipes/before_fb_fstab.rb +++ b/cookbooks/fb_swap/recipes/before_fb_fstab.rb @@ -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 diff --git a/cookbooks/fb_sysctl/resources/default.rb b/cookbooks/fb_sysctl/resources/default.rb index abdf349c0..c24051c84 100644 --- a/cookbooks/fb_sysctl/resources/default.rb +++ b/cookbooks/fb_sysctl/resources/default.rb @@ -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]})" diff --git a/cookbooks/fb_system_upgrade/resources/default.rb b/cookbooks/fb_system_upgrade/resources/default.rb index da6e6afb5..ddeaa5e05 100644 --- a/cookbooks/fb_system_upgrade/resources/default.rb +++ b/cookbooks/fb_system_upgrade/resources/default.rb @@ -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( diff --git a/cookbooks/fb_systemd/resources/loader_entries.rb b/cookbooks/fb_systemd/resources/loader_entries.rb index 9ac095904..0dc2a0948 100644 --- a/cookbooks/fb_systemd/resources/loader_entries.rb +++ b/cookbooks/fb_systemd/resources/loader_entries.rb @@ -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 diff --git a/cookbooks/fb_timers/resources/setup.rb b/cookbooks/fb_timers/resources/setup.rb index 818300d39..db5aa68e6 100644 --- a/cookbooks/fb_timers/resources/setup.rb +++ b/cookbooks/fb_timers/resources/setup.rb @@ -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.