diff options
author | Tim Smith <tsmith@chef.io> | 2021-05-12 12:34:47 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2021-05-12 12:39:16 -0700 |
commit | 25f5b9f2cd5843aa442486f1f8ef926b1e0e5e9f (patch) | |
tree | 7b9798587d3f31cbca998b53d41fd0802031eb03 | |
parent | 71e000e3b6fadd349bd5c826a44904c1144c97d1 (diff) | |
download | chef-25f5b9f2cd5843aa442486f1f8ef926b1e0e5e9f.tar.gz |
Make sure we have description fields in actions and fix periods
Make sure out generated docs are correct
Signed-off-by: Tim Smith <tsmith@chef.io>
61 files changed, 108 insertions, 167 deletions
diff --git a/lib/chef/resource/alternatives.rb b/lib/chef/resource/alternatives.rb index 91e778b643..59939543ab 100644 --- a/lib/chef/resource/alternatives.rb +++ b/lib/chef/resource/alternatives.rb @@ -122,7 +122,7 @@ class Chef end end - action :install, description: "Install an alternative on the system including symlinks" do + action :install, description: "Install an alternative on the system including symlinks." do if path_priority != new_resource.priority converge_by("adding alternative #{new_resource.link} #{new_resource.link_name} #{new_resource.path} #{new_resource.priority}") do output = shell_out(alternatives_cmd, "--install", new_resource.link, new_resource.link_name, new_resource.path, new_resource.priority) @@ -133,7 +133,7 @@ class Chef end end - action :set, description: "Set the symlink for an alternative" do + action :set, description: "Set the symlink for an alternative." do if current_path != new_resource.path converge_by("setting alternative #{new_resource.link_name} #{new_resource.path}") do output = shell_out(alternatives_cmd, "--set", new_resource.link_name, new_resource.path) @@ -144,7 +144,7 @@ class Chef end end - action :remove, description: "Remove an alternative and all associated links" do + action :remove, description: "Remove an alternative and all associated links." do if path_exists? converge_by("removing alternative #{new_resource.link_name} #{new_resource.path}") do shell_out(alternatives_cmd, "--remove", new_resource.link_name, new_resource.path) @@ -152,13 +152,13 @@ class Chef end end - action :auto, description: "Set an alternative up in automatic mode with the highest priority automatically selected" do + action :auto, description: "Set an alternative up in automatic mode with the highest priority automatically selected." do converge_by("setting auto alternative #{new_resource.link_name}") do shell_out(alternatives_cmd, "--auto", new_resource.link_name) end end - action :refresh, description: "Refresh alternatives" do + action :refresh, description: "Refresh alternatives." do converge_by("refreshing alternative #{new_resource.link_name}") do shell_out(alternatives_cmd, "--refresh", new_resource.link_name) end diff --git a/lib/chef/resource/apt_preference.rb b/lib/chef/resource/apt_preference.rb index 89070dc7c5..09e56b1edf 100644 --- a/lib/chef/resource/apt_preference.rb +++ b/lib/chef/resource/apt_preference.rb @@ -91,7 +91,7 @@ class Chef end end - action :add, description: "Creates a preferences file under `/etc/apt/preferences.d`" do + action :add, description: "Creates a preferences file under `/etc/apt/preferences.d`." do return unless debian? preference = build_pref( @@ -130,7 +130,7 @@ class Chef end end - action :remove, description: "Removes the preferences file, thus unpinning the package" do + action :remove, description: "Removes the preferences file, thus unpinning the package." do return unless debian? sanitized_prefname = safe_name(new_resource.package_name) diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index 33a9435ae4..97dc26b89e 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -409,7 +409,7 @@ class Chef end end - action :add, description: "Creates a repository file at `/etc/apt/sources.list.d/` and builds the repository listing" do + action :add, description: "Creates a repository file at `/etc/apt/sources.list.d/` and builds the repository listing." do return unless debian? execute "apt-cache gencaches" do @@ -459,7 +459,7 @@ class Chef end end - action :remove, description: "Removes the repository listing" do + action :remove, description: "Removes the repository listing." do return unless debian? cleanup_legacy_file! diff --git a/lib/chef/resource/apt_update.rb b/lib/chef/resource/apt_update.rb index fde53ec1d8..db87fefc91 100644 --- a/lib/chef/resource/apt_update.rb +++ b/lib/chef/resource/apt_update.rb @@ -86,7 +86,7 @@ class Chef end end - action :periodic, description: "Update the Apt repository at the interval specified by the `frequency` property" do + action :periodic, description: "Update the Apt repository at the interval specified by the `frequency` property." do return unless debian? unless apt_up_to_date? @@ -96,7 +96,7 @@ class Chef end end - action :update, description: "Update the Apt repository at the start of a #{ChefUtils::Dist::Infra::PRODUCT} run" do + action :update, description: "Update the Apt repository at the start of a #{ChefUtils::Dist::Infra::PRODUCT} run." do return unless debian? converge_by "force update new lists of packages" do diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb index 84c2125cd5..8b4c142e0f 100644 --- a/lib/chef/resource/build_essential.rb +++ b/lib/chef/resource/build_essential.rb @@ -57,7 +57,7 @@ class Chef introduced: "15.5", default: false, desired_state: false # FIXME: make this default to true - action :install, description: "Install build essential packages" do + action :install, description: "Install build essential packages." do case when debian? package %w{ autoconf binutils-doc bison build-essential flex gettext ncurses-dev } diff --git a/lib/chef/resource/chef_client_config.rb b/lib/chef/resource/chef_client_config.rb index c9e238ce48..2cc2f7ebdc 100644 --- a/lib/chef/resource/chef_client_config.rb +++ b/lib/chef/resource/chef_client_config.rb @@ -227,7 +227,7 @@ class Chef property :additional_config, String, description: "Additional text to add at the bottom of the client.rb config. This can be used to run custom Ruby or to add less common config options" - action :create, description: "Create a client.rb config file" do + action :create, description: "Create a client.rb config file." do unless ::Dir.exist?(new_resource.config_directory) directory new_resource.config_directory do user new_resource.user unless new_resource.user.nil? @@ -284,7 +284,7 @@ class Chef end end - action :remove, description: "Remove a client.rb config file" do + action :remove, description: "Remove a client.rb config file." do file ::File.join(new_resource.config_directory, "client.rb") do action :delete end diff --git a/lib/chef/resource/chef_client_cron.rb b/lib/chef/resource/chef_client_cron.rb index 3d989dc88e..cab2adacf2 100644 --- a/lib/chef/resource/chef_client_cron.rb +++ b/lib/chef/resource/chef_client_cron.rb @@ -144,7 +144,7 @@ class Chef coerce: proc { |x| Integer(x) }, callbacks: { "should be an Integer between -20 and 19" => proc { |v| v >= -20 && v <= 19 } } - action :add, description: "Add a cron job to run #{ChefUtils::Dist::Infra::PRODUCT}" do + action :add, description: "Add a cron job to run #{ChefUtils::Dist::Infra::PRODUCT}." do # TODO: Replace this with a :create_if_missing action on directory when that exists unless ::Dir.exist?(new_resource.log_directory) directory new_resource.log_directory do @@ -168,7 +168,7 @@ class Chef end end - action :remove, description: "Remove a cron job for #{ChefUtils::Dist::Infra::PRODUCT}" do + action :remove, description: "Remove a cron job for #{ChefUtils::Dist::Infra::PRODUCT}." do declare_resource(cron_resource_type, new_resource.job_name) do action :delete end diff --git a/lib/chef/resource/chef_handler.rb b/lib/chef/resource/chef_handler.rb index a07ba77d64..099f95a52e 100644 --- a/lib/chef/resource/chef_handler.rb +++ b/lib/chef/resource/chef_handler.rb @@ -194,7 +194,7 @@ class Chef # This action needs to find an rb file that presumably contains the indicated class in it and the # load that file. It then instantiates that class by name and registers it as a handler. - action :enable, description: "Enables the handler for the current #{ChefUtils::Dist::Infra::PRODUCT} run on the current node" do + action :enable, description: "Enables the handler for the current #{ChefUtils::Dist::Infra::PRODUCT} run on the current node." do class_name = new_resource.class_name new_resource.type.each do |type, enable| next unless enable @@ -216,7 +216,7 @@ class Chef end end - action :disable, description: "Disables the handler for the current #{ChefUtils::Dist::Infra::PRODUCT} run on the current node" do + action :disable, description: "Disables the handler for the current #{ChefUtils::Dist::Infra::PRODUCT} run on the current node." do new_resource.type.each_key do |type| unregister_handler(type, new_resource.class_name) end diff --git a/lib/chef/resource/chef_sleep.rb b/lib/chef/resource/chef_sleep.rb index 2cd43af1ae..13f737c0c4 100644 --- a/lib/chef/resource/chef_sleep.rb +++ b/lib/chef/resource/chef_sleep.rb @@ -62,7 +62,7 @@ class Chef coerce: proc { |s| Integer(s) }, name_property: true - action :sleep, description: "Pause the #{ChefUtils::Dist::Infra::PRODUCT} run for a specified number of seconds" do + action :sleep, description: "Pause the #{ChefUtils::Dist::Infra::PRODUCT} run for a specified number of seconds." do converge_by("sleep #{new_resource.seconds} seconds") do sleep(new_resource.seconds) end diff --git a/lib/chef/resource/chocolatey_feature.rb b/lib/chef/resource/chocolatey_feature.rb index 764bbca99d..b56d11376e 100644 --- a/lib/chef/resource/chocolatey_feature.rb +++ b/lib/chef/resource/chocolatey_feature.rb @@ -65,7 +65,7 @@ class Chef data ? data.attribute("enabled").to_s : nil # REXML just returns nil if it can't find anything so avoid an undefined method error end - action :enable, description: "Enables a named Chocolatey feature" do + action :enable, description: "Enables a named Chocolatey feature." do if current_resource.feature_state != true converge_by("enable Chocolatey feature '#{new_resource.feature_name}'") do shell_out!(choco_cmd("enable")) @@ -73,7 +73,7 @@ class Chef end end - action :disable, description: "Disables a named Chocolatey feature" do + action :disable, description: "Disables a named Chocolatey feature." do if current_resource.feature_state == true converge_by("disable Chocolatey feature '#{new_resource.feature_name}'") do shell_out!(choco_cmd("disable")) diff --git a/lib/chef/resource/chocolatey_source.rb b/lib/chef/resource/chocolatey_source.rb index b4d7c6234a..1b287fc188 100644 --- a/lib/chef/resource/chocolatey_source.rb +++ b/lib/chef/resource/chocolatey_source.rb @@ -98,7 +98,7 @@ class Chef end end - action :remove, description: "Removes a Chocolatey source" do + action :remove, description: "Removes a Chocolatey source." do if current_resource converge_by("remove Chocolatey source '#{new_resource.source_name}'") do diff --git a/lib/chef/resource/cron/cron_d.rb b/lib/chef/resource/cron/cron_d.rb index 7fea6ac76d..3b8e4fa06a 100644 --- a/lib/chef/resource/cron/cron_d.rb +++ b/lib/chef/resource/cron/cron_d.rb @@ -121,14 +121,12 @@ class Chef create_template(:create) end - action :create_if_missing do - description "Add a cron definition file to /etc/cron.d, but do not update an existing file." + action :create_if_missing, description: "Add a cron definition file to /etc/cron.d, but do not update an existing file." do create_template(:create_if_missing) end - action :delete do - description "Remove a cron definition file from /etc/cron.d if it exists." + action :delete, description: "Remove a cron definition file from /etc/cron.d if it exists." do # cleanup the legacy named job if it exists file "legacy named cron.d file" do diff --git a/lib/chef/resource/cron_access.rb b/lib/chef/resource/cron_access.rb index 2183e6fb33..233931e64a 100644 --- a/lib/chef/resource/cron_access.rb +++ b/lib/chef/resource/cron_access.rb @@ -64,7 +64,7 @@ class Chef "default" => "/etc", }.freeze - action :allow, description: "Add the user to the cron.allow file" do + action :allow, description: "Add the user to the cron.allow file." do allow_path = ::File.join(value_for_platform_family(CRON_PATHS), "cron.allow") with_run_context :root do diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb index 9484de7fe8..9f898e92ea 100644 --- a/lib/chef/resource/dmg_package.rb +++ b/lib/chef/resource/dmg_package.rb @@ -121,7 +121,7 @@ class Chef end end - action :install, description: "Installs the application" do + action :install, description: "Installs the application." do if current_resource.nil? if new_resource.source remote_file dmg_file do diff --git a/lib/chef/resource/homebrew_cask.rb b/lib/chef/resource/homebrew_cask.rb index 31134545fc..14f2ea3383 100644 --- a/lib/chef/resource/homebrew_cask.rb +++ b/lib/chef/resource/homebrew_cask.rb @@ -53,7 +53,7 @@ class Chef description: "The owner of the Homebrew installation.", default: lazy { find_homebrew_username } - action :install, description: "Install an application packaged as a Homebrew cask" do + action :install, description: "Install an application packaged as a Homebrew cask." do homebrew_tap "homebrew/cask" if new_resource.install_cask unless casked? @@ -66,7 +66,7 @@ class Chef end end - action :remove, description: "Remove an application packaged as a Homebrew cask" do + action :remove, description: "Remove an application packaged as a Homebrew cask." do homebrew_tap "homebrew/cask" if new_resource.install_cask if casked? diff --git a/lib/chef/resource/homebrew_tap.rb b/lib/chef/resource/homebrew_tap.rb index 672f2f9995..9f31463652 100644 --- a/lib/chef/resource/homebrew_tap.rb +++ b/lib/chef/resource/homebrew_tap.rb @@ -53,7 +53,7 @@ class Chef description: "The owner of the Homebrew installation.", default: lazy { find_homebrew_username } - action :tap, description: "Add a Homebrew tap" do + action :tap, description: "Add a Homebrew tap." do unless tapped?(new_resource.tap_name) converge_by("tap #{new_resource.tap_name}") do shell_out!("#{new_resource.homebrew_path} tap #{new_resource.full ? "--full" : ""} #{new_resource.tap_name} #{new_resource.url || ""}", @@ -64,7 +64,7 @@ class Chef end end - action :untap, description: "Remove a Homebrew tap" do + action :untap, description: "Remove a Homebrew tap." do if tapped?(new_resource.tap_name) converge_by("untap #{new_resource.tap_name}") do shell_out!("#{new_resource.homebrew_path} untap #{new_resource.tap_name}", diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb index 8a9d3bea13..644f940712 100644 --- a/lib/chef/resource/hostname.rb +++ b/lib/chef/resource/hostname.rb @@ -103,7 +103,7 @@ class Chef end end - action :set, description: "Sets the node's hostname" do + action :set, description: "Sets the node's hostname." do if !windows? ohai "reload hostname" do plugin "hostname" diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb index e51c1e038d..bba53077d1 100644 --- a/lib/chef/resource/kernel_module.rb +++ b/lib/chef/resource/kernel_module.rb @@ -93,7 +93,7 @@ class Chef description: "The modprobe.d directory.", default: "/etc/modprobe.d" - action :install, description: "Load kernel module, and ensure it loads on reboot" do + action :install, description: "Load kernel module, and ensure it loads on reboot." do with_run_context :root do find_resource(:execute, "update initramfs") do command initramfs_command @@ -121,7 +121,7 @@ class Chef end end - action :uninstall, description: "Unload a kernel module and remove module config, so it doesn't load on reboot" do + action :uninstall, description: "Unload a kernel module and remove module config, so it doesn't load on reboot." do with_run_context :root do find_resource(:execute, "update initramfs") do command initramfs_command @@ -146,7 +146,7 @@ class Chef action_unload end - action :blacklist, description: "Blacklist a kernel module" do + action :blacklist, description: "Blacklist a kernel module." do with_run_context :root do find_resource(:execute, "update initramfs") do command initramfs_command @@ -162,7 +162,7 @@ class Chef action_unload end - action :disable, description: "Disable a kernel module" do + action :disable, description: "Disable a kernel module." do with_run_context :root do find_resource(:execute, "update initramfs") do command initramfs_command @@ -178,7 +178,7 @@ class Chef action_unload end - action :load, description: "Load a kernel module" do + action :load, description: "Load a kernel module." do unless module_loaded? converge_by("load kernel module #{new_resource.modname}") do shell_out!("modprobe #{new_resource.modname}") @@ -186,7 +186,7 @@ class Chef end end - action :unload, description: "Unload kernel module" do + action :unload, description: "Unload kernel module." do if module_loaded? converge_by("unload kernel module #{new_resource.modname}") do shell_out!("modprobe -r #{new_resource.modname}") diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb index 552b654867..90377ef93a 100644 --- a/lib/chef/resource/locale.rb +++ b/lib/chef/resource/locale.rb @@ -97,7 +97,7 @@ class Chef powershell_exec("Get-WinSystemLocale").result["Name"] end - action :update, description: "Update the system's locale" do + action :update, description: "Update the system's locale." do converge_if_changed do set_system_locale end diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb index 832549b119..036bd96d8b 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -140,7 +140,7 @@ class Chef state_cmd end - action :write, description: "Write the value to the specified domain/key" do + action :write, description: "Write the value to the specified domain/key." do converge_if_changed do cmd = defaults_modify_cmd Chef::Log.debug("Updating defaults value by shelling out: #{cmd.join(" ")}") @@ -149,7 +149,7 @@ class Chef end end - action :delete, description: "Delete a key from a domain" do + action :delete, description: "Delete a key from a domain." do # if it's not there there's nothing to remove return unless current_resource diff --git a/lib/chef/resource/ohai_hint.rb b/lib/chef/resource/ohai_hint.rb index 88ea02c809..63ddc595c5 100644 --- a/lib/chef/resource/ohai_hint.rb +++ b/lib/chef/resource/ohai_hint.rb @@ -72,9 +72,7 @@ class Chef description: "Determines whether or not the resource is executed during the compile time phase.", default: true, desired_state: false - action :create do - description "Create an Ohai hint file." - + action :create, description: "Create an Ohai hint file." do directory ::Ohai::Config.ohai.hints_path.first do action :create recursive true @@ -86,9 +84,7 @@ class Chef end end - action :delete do - description "Delete an Ohai hint file." - + action :delete, description: "Delete an Ohai hint file." do file ohai_hint_file_path(new_resource.hint_name) do action :delete notifies :reload, ohai[reload ohai post hint removal] diff --git a/lib/chef/resource/openssl_dhparam.rb b/lib/chef/resource/openssl_dhparam.rb index 3d20b1b439..84d89a6b82 100644 --- a/lib/chef/resource/openssl_dhparam.rb +++ b/lib/chef/resource/openssl_dhparam.rb @@ -88,8 +88,7 @@ class Chef description: "The permission mode applied to all files created by the resource.", default: "0640" - action :create do - description "Create the dhparam file." + action :create, description: "Create the dhparam file." do dhparam_content = nil unless dhparam_pem_valid?(new_resource.path) dhparam_content = gen_dhparam(new_resource.key_length, new_resource.generator).to_pem diff --git a/lib/chef/resource/openssl_ec_private_key.rb b/lib/chef/resource/openssl_ec_private_key.rb index 844ee5a4c9..f3f88182af 100644 --- a/lib/chef/resource/openssl_ec_private_key.rb +++ b/lib/chef/resource/openssl_ec_private_key.rb @@ -88,9 +88,7 @@ class Chef description: "Force creation of the key even if the same key already exists on the node.", default: false, desired_state: false - action :create do - description "Generate the ec private key" - + action :create, description: "Generate the ec private key." do unless new_resource.force || priv_key_file_valid?(new_resource.path, new_resource.key_pass) converge_by("Create an EC private key #{new_resource.path}") do log "Generating an #{new_resource.key_curve} "\ diff --git a/lib/chef/resource/openssl_ec_public_key.rb b/lib/chef/resource/openssl_ec_public_key.rb index 44441eb72d..0cf81e4ee0 100644 --- a/lib/chef/resource/openssl_ec_public_key.rb +++ b/lib/chef/resource/openssl_ec_public_key.rb @@ -74,9 +74,7 @@ class Chef description: "The permission mode applied to all files created by the resource.", default: "0640" - action :create do - description "Generate the ec public key from a private key" - + action :create, description: "Generate the ec public key from a private key." do raise ArgumentError, "You cannot specify both 'private_key_path' and 'private_key_content' properties at the same time." if new_resource.private_key_path && new_resource.private_key_content raise ArgumentError, "You must specify the private key with either 'private_key_path' or 'private_key_content' properties." unless new_resource.private_key_path || new_resource.private_key_content raise "#{new_resource.private_key_path} not a valid private EC key or password is invalid" unless priv_key_file_valid?((new_resource.private_key_path || new_resource.private_key_content), new_resource.private_key_pass) diff --git a/lib/chef/resource/openssl_rsa_private_key.rb b/lib/chef/resource/openssl_rsa_private_key.rb index ff41b6f797..43cc131320 100644 --- a/lib/chef/resource/openssl_rsa_private_key.rb +++ b/lib/chef/resource/openssl_rsa_private_key.rb @@ -87,9 +87,7 @@ class Chef description: "Force creation of the key even if the same key already exists on the node.", default: false, desired_state: false - action :create do - description "Create the RSA private key." - + action :create, description: "Create the RSA private key." do return if new_resource.force || priv_key_file_valid?(new_resource.path, new_resource.key_pass) converge_by("create #{new_resource.key_length} bit RSA key #{new_resource.path}") do diff --git a/lib/chef/resource/openssl_rsa_public_key.rb b/lib/chef/resource/openssl_rsa_public_key.rb index 8fd8ab558e..59e63368c1 100644 --- a/lib/chef/resource/openssl_rsa_public_key.rb +++ b/lib/chef/resource/openssl_rsa_public_key.rb @@ -75,9 +75,7 @@ class Chef description: "The permission mode applied to all files created by the resource.", default: "0640" - action :create do - description "Create the RSA public key." - + action :create, description: "Create the RSA public key." do raise ArgumentError, "You cannot specify both 'private_key_path' and 'private_key_content' properties at the same time." if new_resource.private_key_path && new_resource.private_key_content raise ArgumentError, "You must specify the private key with either 'private_key_path' or 'private_key_content' properties." unless new_resource.private_key_path || new_resource.private_key_content raise "#{new_resource.private_key_path} not a valid private RSA key or password is invalid" unless priv_key_file_valid?((new_resource.private_key_path || new_resource.private_key_content), new_resource.private_key_pass) diff --git a/lib/chef/resource/openssl_x509_certificate.rb b/lib/chef/resource/openssl_x509_certificate.rb index e8ad9b62b7..8c36a18ed6 100644 --- a/lib/chef/resource/openssl_x509_certificate.rb +++ b/lib/chef/resource/openssl_x509_certificate.rb @@ -151,9 +151,7 @@ class Chef description: "The number of days before the expiry. The certificate will be automatically renewed when the value is reached.", introduced: "15.7" - action :create do - description "Generate a certificate" - + action :create, description: "Generate a certificate." do file new_resource.path do action :create_if_missing owner new_resource.owner unless new_resource.owner.nil? diff --git a/lib/chef/resource/openssl_x509_crl.rb b/lib/chef/resource/openssl_x509_crl.rb index 6e7f905084..0b20ee7209 100644 --- a/lib/chef/resource/openssl_x509_crl.rb +++ b/lib/chef/resource/openssl_x509_crl.rb @@ -90,9 +90,7 @@ class Chef property :mode, [Integer, String], description: "The permission mode of the CRL file." - action :create do - description "Create the CRL file." - + action :create, description: "Create the CRL file." do file new_resource.path do owner new_resource.owner unless new_resource.owner.nil? group new_resource.group unless new_resource.group.nil? diff --git a/lib/chef/resource/openssl_x509_request.rb b/lib/chef/resource/openssl_x509_request.rb index 0e68337b05..6dcb7b13d5 100644 --- a/lib/chef/resource/openssl_x509_request.rb +++ b/lib/chef/resource/openssl_x509_request.rb @@ -119,9 +119,7 @@ class Chef equal_to: %w{secp384r1 secp521r1 prime256v1}, default: "prime256v1", description: "The desired curve of the generated key (if key_type is equal to `ec`). Run `openssl ecparam -list_curves` to see available options." - action :create do - description "Generate a certificate request." - + action :create, description: "Generate a certificate request." do unless ::File.exist? new_resource.path converge_by("Create CSR #{@new_resource}") do file new_resource.path do diff --git a/lib/chef/resource/powershell_package_source.rb b/lib/chef/resource/powershell_package_source.rb index 066efc6a72..c4c4d2c841 100644 --- a/lib/chef/resource/powershell_package_source.rb +++ b/lib/chef/resource/powershell_package_source.rb @@ -70,8 +70,7 @@ class Chef script_publish_location status["script_publish_location"] end - action :register do - description "Registers and updates the powershell package source." + action :register, description: "Registers and updates the PowerShell package source." do # TODO: Ensure package provider is installed? if psrepository_cmdlet_appropriate? if package_source_exists? @@ -104,8 +103,7 @@ class Chef end end - action :unregister do - description "Unregisters the powershell package source." + action :unregister, description: "Unregisters the PowerShell package source." do if package_source_exists? unregister_cmd = "Get-PackageSource -Name '#{new_resource.source_name}' | Unregister-PackageSource" converge_by("unregister source: #{new_resource.source_name}") do diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb index 6ac19e299b..717b9255b6 100644 --- a/lib/chef/resource/reboot.rb +++ b/lib/chef/resource/reboot.rb @@ -42,18 +42,14 @@ class Chef description: "The amount of time (in minutes) to delay a reboot request.", default: 0 - action :request_reboot do - description "Reboot a node at the end of a chef-client run." - + action :request_reboot, description: "Reboot a node at the end of a #{ChefUtils::Dist::Infra::PRODUCT} run." do converge_by("request a system reboot to occur if the run succeeds") do logger.warn "Reboot requested:'#{new_resource.name}'" request_reboot end end - action :reboot_now do - description "Reboot a node so that the chef-client may continue the installation process." - + action :reboot_now, description: "Reboot a node so that the #{ChefUtils::Dist::Infra::PRODUCT} may continue the installation process." do converge_by("rebooting the system immediately") do logger.warn "Rebooting system immediately, requested by '#{new_resource.name}'" request_reboot @@ -61,9 +57,7 @@ class Chef end end - action :cancel do - description "Cancel a pending reboot request." - + action :cancel, description: "Cancel a pending reboot request." do converge_by("cancel any existing end-of-run reboot request") do logger.warn "Reboot canceled: '#{new_resource.name}'" node.run_context.cancel_reboot diff --git a/lib/chef/resource/rhsm_errata.rb b/lib/chef/resource/rhsm_errata.rb index 354a641fe5..d3e4a8b8b2 100644 --- a/lib/chef/resource/rhsm_errata.rb +++ b/lib/chef/resource/rhsm_errata.rb @@ -46,8 +46,6 @@ class Chef name_property: true action :install, description: "Install a package for a specific errata ID." do - description "Installs a package for a specific errata ID." - execute "Install errata packages for #{new_resource.errata_id}" do command "#{package_manager_command} update --advisory #{new_resource.errata_id} -y" default_env true diff --git a/lib/chef/resource/rhsm_errata_level.rb b/lib/chef/resource/rhsm_errata_level.rb index 7aa61ad90c..52d3458d91 100644 --- a/lib/chef/resource/rhsm_errata_level.rb +++ b/lib/chef/resource/rhsm_errata_level.rb @@ -42,11 +42,7 @@ class Chef name_property: true action :install, description: "Install all packages of the specified errata level." do - description "Install all packages of the specified errata level." - - if rhel6? - yum_package "yum-plugin-security" - end + yum_package "yum-plugin-security" if rhel6? execute "Install any #{new_resource.errata_level} errata" do command "#{package_manager_command} update --sec-severity=#{new_resource.errata_level.capitalize} -y" diff --git a/lib/chef/resource/ssh_known_hosts_entry.rb b/lib/chef/resource/ssh_known_hosts_entry.rb index 1db811978c..3040732ce8 100644 --- a/lib/chef/resource/ssh_known_hosts_entry.rb +++ b/lib/chef/resource/ssh_known_hosts_entry.rb @@ -85,9 +85,7 @@ class Chef description: "The location of the ssh known hosts file. Change this to set a known host file for a particular user.", default: "/etc/ssh/ssh_known_hosts" - action :create do - description "Create an entry in the ssh_known_hosts file." - + action :create, description: "Create an entry in the ssh_known_hosts file." do key = if new_resource.key hoststr = (new_resource.port != 22) ? "[#{new_resource.host}]:#{new_resource.port}" : new_resource.host @@ -129,9 +127,7 @@ class Chef end # all this does is send an immediate run_action(:create) to the template resource - action :flush do - description "Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the #{ChefUtils::Dist::Infra::PRODUCT} run so all entries can be accumulated before writing the file out." - + action :flush, description: "Immediately flush the entries to the config file. Without this the actual writing of the file is delayed in the #{ChefUtils::Dist::Infra::PRODUCT} run so all entries can be accumulated before writing the file out." do with_run_context :root do # if you haven't ever called ssh_known_hosts_entry before you're definitely doing it wrong so we blow up hard. find_resource!(:template, "update ssh known hosts file #{new_resource.file_location}").run_action(:create) diff --git a/lib/chef/resource/sudo.rb b/lib/chef/resource/sudo.rb index f7405f2270..12b01b7f95 100644 --- a/lib/chef/resource/sudo.rb +++ b/lib/chef/resource/sudo.rb @@ -170,9 +170,7 @@ class Chef end end - action :create do - description "Create a single sudoers config in the sudoers.d directory" - + action :create, description: "Create a single sudoers config in the sudoers.d directory." do validate_properties if docker? # don't even put this into resource collection unless we're in docker @@ -230,9 +228,7 @@ class Chef end # Removes a user from the sudoers group - action :delete do - description "Remove a sudoers config from the sudoers.d directory" - + action :delete, description: "Remove a sudoers config from the sudoers.d directory." do file "#{new_resource.config_prefix}/sudoers.d/#{new_resource.filename}" do action :delete end diff --git a/lib/chef/resource/swap_file.rb b/lib/chef/resource/swap_file.rb index 3d8f31de48..bd2c7bf632 100644 --- a/lib/chef/resource/swap_file.rb +++ b/lib/chef/resource/swap_file.rb @@ -63,9 +63,7 @@ class Chef property :swappiness, Integer, description: "The swappiness value to set on the system." - action :create do - description "Create a swapfile." - + action :create, description: "Create a swapfile." do if swap_enabled? Chef::Log.debug("#{new_resource} already created - nothing to do") else @@ -85,9 +83,7 @@ class Chef end end - action :remove do - description "Remove a swapfile and disable swap." - + action :remove, description: "Remove a swapfile and disable swap." do swapoff if swap_enabled? remove_swapfile if ::File.exist?(new_resource.path) end diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb index 49f8a180ee..9c36206e14 100644 --- a/lib/chef/resource/sysctl.rb +++ b/lib/chef/resource/sysctl.rb @@ -131,7 +131,7 @@ class Chef end - action :apply, description: "Apply a sysctl value" do + action :apply, description: "Apply a sysctl value." do converge_if_changed do # set it temporarily set_sysctl_param(new_resource.key, new_resource.value) @@ -150,7 +150,7 @@ class Chef end end - action :remove, description: "Remove a sysctl value" do + action :remove, description: "Remove a sysctl value." do # only converge the resource if the file actually exists to delete if ::File.exist?("#{new_resource.conf_dir}/99-chef-#{new_resource.key.tr("/", ".")}.conf") converge_by "removing sysctl config at #{new_resource.conf_dir}/99-chef-#{new_resource.key.tr("/", ".")}.conf" do diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb index 584c2437c7..489b94b0b3 100644 --- a/lib/chef/resource/timezone.rb +++ b/lib/chef/resource/timezone.rb @@ -119,7 +119,7 @@ class Chef end end - action :set, description: "Set the system timezone" do + action :set, description: "Set the system timezone." do # we have to check windows first since the value isn't case sensitive here if windows? unless current_windows_tz.casecmp?(new_resource.timezone) diff --git a/lib/chef/resource/user_ulimit.rb b/lib/chef/resource/user_ulimit.rb index f004bb1aa2..55331dfc1c 100644 --- a/lib/chef/resource/user_ulimit.rb +++ b/lib/chef/resource/user_ulimit.rb @@ -78,7 +78,7 @@ class Chef coerce: proc { |m| m.end_with?(".conf") ? m : m + ".conf" }, default: lazy { |r| r.username == "*" ? "00_all_limits.conf" : "#{r.username}_limits.conf" } - action :create, description: "Create a ulimit configuration file" do + action :create, description: "Create a ulimit configuration file." do template "/etc/security/limits.d/#{new_resource.filename}" do source ::File.expand_path("support/ulimit.erb", __dir__) local true @@ -106,7 +106,7 @@ class Chef end end - action :delete, description: "Delete an existing ulimit configuration file" do + action :delete, description: "Delete an existing ulimit configuration file." do file "/etc/security/limits.d/#{new_resource.filename}" do action :delete end diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb index 0c14150753..e285e1cf1e 100644 --- a/lib/chef/resource/windows_ad_join.rb +++ b/lib/chef/resource/windows_ad_join.rb @@ -97,7 +97,7 @@ class Chef property :sensitive, [TrueClass, FalseClass], default: true, desired_state: false - action :join, description: "Join the Active Directory domain" do + action :join, description: "Join the Active Directory domain." do unless on_desired_domain? cmd = "$pswd = ConvertTo-SecureString \'#{new_resource.domain_password}\' -AsPlainText -Force;" cmd << "$credential = New-Object System.Management.Automation.PSCredential (\"#{sanitize_usename}\",$pswd);" @@ -127,7 +127,7 @@ class Chef end end - action :leave, description: "Leave an Active Directory domain and re-join a workgroup" do + action :leave, description: "Leave an Active Directory domain and re-join a workgroup." do if joined_to_domain? cmd = "" cmd << "$pswd = ConvertTo-SecureString \'#{new_resource.domain_password}\' -AsPlainText -Force;" diff --git a/lib/chef/resource/windows_audit_policy.rb b/lib/chef/resource/windows_audit_policy.rb index 922a4eaf66..15d6eef0a2 100644 --- a/lib/chef/resource/windows_audit_policy.rb +++ b/lib/chef/resource/windows_audit_policy.rb @@ -152,7 +152,7 @@ class Chef property :audit_base_directories, [true, false], description: "Setting this audit policy option to true will force the system to assign a System Access Control List to named objects to enable auditing of container objects such as directories." - action :set, description: "Configure an audit policy" do + action :set, description: "Configure an audit policy." do unless new_resource.subcategory.nil? new_resource.subcategory.each do |subcategory| next if subcategory_configured?(subcategory, new_resource.success, new_resource.failure) diff --git a/lib/chef/resource/windows_auto_run.rb b/lib/chef/resource/windows_auto_run.rb index 4d3f7cdcaa..9e46b58b53 100644 --- a/lib/chef/resource/windows_auto_run.rb +++ b/lib/chef/resource/windows_auto_run.rb @@ -57,7 +57,7 @@ class Chef alias_method :program, :path - action :create, description: "Create an item to be run at login" do + action :create, description: "Create an item to be run at login." do data = "\"#{new_resource.path}\"" data << " #{new_resource.args}" if new_resource.args @@ -72,7 +72,7 @@ class Chef end end - action :remove, description: "Remove an item that was previously configured to run at login" do + action :remove, description: "Remove an item that was previously configured to run at login." do registry_key registry_path do values [{ name: new_resource.program_name, diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb index 4ac0effa58..528b0c53f6 100644 --- a/lib/chef/resource/windows_certificate.rb +++ b/lib/chef/resource/windows_certificate.rb @@ -160,7 +160,7 @@ class Chef end end - action :verify, description: "Verifies a certificate and logs the result" do + action :verify, description: "Verifies a certificate and logs the result." do out = verify_cert if !!out == out out = out ? "Certificate is valid" : "Certificate not valid" diff --git a/lib/chef/resource/windows_dfs_folder.rb b/lib/chef/resource/windows_dfs_folder.rb index 9d81255dea..b9ef4525f9 100644 --- a/lib/chef/resource/windows_dfs_folder.rb +++ b/lib/chef/resource/windows_dfs_folder.rb @@ -42,7 +42,7 @@ class Chef property :description, String, description: "Description for the share." - action :create, description: "Creates the folder in dfs namespace" do + action :create, description: "Creates the folder in dfs namespace." do raise "target_path is required for install" unless property_is_set?(:target_path) raise "description is required for install" unless property_is_set?(:description) @@ -60,7 +60,7 @@ class Chef end end - action :delete, description: "Deletes the folder in the dfs namespace" do + action :delete, description: "Deletes the folder in the dfs namespace." do powershell_script "Delete DFS Namespace" do code <<-EOH Remove-DfsnFolder -Path '\\\\#{ENV["COMPUTERNAME"]}\\#{new_resource.namespace_name}\\#{new_resource.folder_path}' -Force diff --git a/lib/chef/resource/windows_dfs_namespace.rb b/lib/chef/resource/windows_dfs_namespace.rb index a0e2ed20fc..2fdfd8ebb6 100644 --- a/lib/chef/resource/windows_dfs_namespace.rb +++ b/lib/chef/resource/windows_dfs_namespace.rb @@ -52,7 +52,7 @@ class Chef description: "The root from which to create the DFS tree. Defaults to C:\\DFSRoots.", default: 'C:\\DFSRoots' - action :create, description: "Creates the dfs namespace on the server" do + action :create, description: "Creates the dfs namespace on the server." do directory file_path do action :create recursive true @@ -82,7 +82,7 @@ class Chef end end - action :delete, description: "Deletes a DFS Namespace including the directory on disk" do + action :delete, description: "Deletes a DFS Namespace including the directory on disk." do powershell_script "Delete DFS Namespace" do code <<-EOH Remove-DfsnRoot -Path '\\\\#{ENV["COMPUTERNAME"]}\\#{new_resource.namespace_name}' -Force diff --git a/lib/chef/resource/windows_dns_record.rb b/lib/chef/resource/windows_dns_record.rb index f68412aee6..8b908f09e6 100644 --- a/lib/chef/resource/windows_dns_record.rb +++ b/lib/chef/resource/windows_dns_record.rb @@ -49,7 +49,7 @@ class Chef default: "localhost", introduced: "16.3" - action :create, description: "Creates and updates the DNS entry" do + action :create, description: "Creates and updates the DNS entry." do windows_feature "RSAT-DNS-Server" do not_if new_resource.dns_server.casecmp?("localhost") end @@ -59,7 +59,7 @@ class Chef run_dsc_resource "Present" end - action :delete, description: "Deletes a DNS entry" do + action :delete, description: "Deletes a DNS entry." do windows_feature "RSAT-DNS-Server" do not_if new_resource.dns_server.casecmp?("localhost") end diff --git a/lib/chef/resource/windows_dns_zone.rb b/lib/chef/resource/windows_dns_zone.rb index 91a4a22147..eb7e42c3ce 100644 --- a/lib/chef/resource/windows_dns_zone.rb +++ b/lib/chef/resource/windows_dns_zone.rb @@ -40,13 +40,13 @@ class Chef description: "The type of DNS server, Domain or Standalone.", default: "Domain", equal_to: %w{Domain Standalone} - action :create, description: "Creates and updates a DNS Zone" do + action :create, description: "Creates and updates a DNS Zone." do powershell_package "xDnsServer" run_dsc_resource "Present" end - action :delete, description: "Deletes a DNS Zone" do + action :delete, description: "Deletes a DNS Zone." do powershell_package "xDnsServer" run_dsc_resource "Absent" diff --git a/lib/chef/resource/windows_feature.rb b/lib/chef/resource/windows_feature.rb index 0e7a61e8f1..ae71b299fe 100644 --- a/lib/chef/resource/windows_feature.rb +++ b/lib/chef/resource/windows_feature.rb @@ -108,15 +108,15 @@ class Chef default: 600, desired_state: false - action :install, description: "Install a Windows role / feature" do + action :install, description: "Install a Windows role or feature." do run_default_subresource :install end - action :remove, description: "Remove a Windows role / feature" do + action :remove, description: "Remove a Windows role or feature." do run_default_subresource :remove end - action :delete, description: "Remove a Windows role/feature from the image" do + action :delete, description: "Remove a Windows role or feature from the image." do run_default_subresource :delete end diff --git a/lib/chef/resource/windows_feature_dism.rb b/lib/chef/resource/windows_feature_dism.rb index 7a0aef9197..a2d91eaede 100644 --- a/lib/chef/resource/windows_feature_dism.rb +++ b/lib/chef/resource/windows_feature_dism.rb @@ -65,9 +65,7 @@ class Chef x.map(&:downcase) end - action :install do - description "Install a Windows role/feature using DISM" - + action :install, description: "Install a Windows role/feature using DISM." do reload_cached_dism_data unless node["dism_features_cache"] fail_if_unavailable # fail if the features don't exist @@ -91,7 +89,7 @@ class Chef end end - action :remove, description: "Remove a Windows role / feature using DISM" do + action :remove, description: "Remove a Windows role or feature using DISM." do reload_cached_dism_data unless node["dism_features_cache"] logger.trace("Windows features needing removal: #{features_to_remove.empty? ? "none" : features_to_remove.join(",")}") @@ -106,7 +104,7 @@ class Chef end end - action :delete, description: "Remove a Windows role / feature from the image using DISM" do + action :delete, description: "Remove a Windows role or feature from the image using DISM." do reload_cached_dism_data unless node["dism_features_cache"] fail_if_unavailable # fail if the features don't exist diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb index 229ceff6ea..e9889eb954 100644 --- a/lib/chef/resource/windows_feature_powershell.rb +++ b/lib/chef/resource/windows_feature_powershell.rb @@ -87,7 +87,7 @@ class Chef x.map(&:downcase) end - action :install, description: "Install a Windows role / feature using PowerShell" do + action :install, description: "Install a Windows role or feature using PowerShell." do reload_cached_powershell_data unless node["powershell_features_cache"] fail_if_unavailable # fail if the features don't exist fail_if_removed # fail if the features are in removed state @@ -108,7 +108,7 @@ class Chef end end - action :remove, description: "Remove a Windows role / feature using PowerShell" do + action :remove, description: "Remove a Windows role or feature using PowerShell." do reload_cached_powershell_data unless node["powershell_features_cache"] Chef::Log.debug("Windows features needing removal: #{features_to_remove.empty? ? "none" : features_to_remove.join(",")}") @@ -123,7 +123,7 @@ class Chef end end - action :delete, description: "Delete a Windows role / feature from the image using PowerShell" do + action :delete, description: "Delete a Windows role or feature from the image using PowerShell." do reload_cached_powershell_data unless node["powershell_features_cache"] fail_if_unavailable # fail if the features don't exist diff --git a/lib/chef/resource/windows_firewall_profile.rb b/lib/chef/resource/windows_firewall_profile.rb index 6baafda9c1..573f4b2cfa 100644 --- a/lib/chef/resource/windows_firewall_profile.rb +++ b/lib/chef/resource/windows_firewall_profile.rb @@ -121,7 +121,7 @@ class Chef end end - action :enable, description: "Enable and optionally configure a Windows Firewall profile" do + action :enable, description: "Enable and optionally configure a Windows Firewall profile." do converge_if_changed :default_inbound_action, :default_outbound_action, :allow_inbound_rules, :allow_local_firewall_rules, :allow_local_ipsec_rules, :allow_user_apps, :allow_user_ports, :allow_unicast_response, :display_notification do fw_cmd = firewall_command(new_resource.profile) @@ -135,7 +135,7 @@ class Chef end end - action :disable, description: "Disable a Windows Firewall profile" do + action :disable, description: "Disable a Windows Firewall profile." do if firewall_enabled?(new_resource.profile) converge_by "Disable the #{new_resource.profile} Firewall Profile" do cmd = "Set-NetFirewallProfile -Profile #{new_resource.profile} -Enabled \"False\"" diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb index 8256ea6df9..069ac650d1 100644 --- a/lib/chef/resource/windows_firewall_rule.rb +++ b/lib/chef/resource/windows_firewall_rule.rb @@ -185,7 +185,7 @@ class Chef enabled state["enabled"] end - action :create, description: "Create a Windows firewall entry" do + action :create, description: "Create a Windows firewall entry." do if current_resource converge_if_changed :rule_name, :description, :displayname, :local_address, :local_port, :remote_address, :remote_port, :direction, :protocol, :icmp_type, :firewall_action, :profile, :program, :service, @@ -206,7 +206,7 @@ class Chef end end - action :delete, description: "Delete an existing Windows firewall entry" do + action :delete, description: "Delete an existing Windows firewall entry." do if current_resource converge_by("delete firewall rule #{new_resource.rule_name}") do powershell_exec!("Remove-NetFirewallRule -Name '#{new_resource.rule_name}'") diff --git a/lib/chef/resource/windows_font.rb b/lib/chef/resource/windows_font.rb index 9043ba94f3..2a8aaa3feb 100644 --- a/lib/chef/resource/windows_font.rb +++ b/lib/chef/resource/windows_font.rb @@ -45,7 +45,7 @@ class Chef description: "A local filesystem path or URI that is used to source the font file.", coerce: proc { |x| /^.:.*/.match?(x) ? x.tr("\\", "/").gsub("//", "/") : x } - action :install, description: "Install a font to the system fonts directory" do + action :install, description: "Install a font to the system fonts directory." do if font_exists? logger.debug("Not installing font: #{new_resource.font_name} as font already installed.") else diff --git a/lib/chef/resource/windows_pagefile.rb b/lib/chef/resource/windows_pagefile.rb index 871f36b3c7..a5f6052849 100644 --- a/lib/chef/resource/windows_pagefile.rb +++ b/lib/chef/resource/windows_pagefile.rb @@ -73,7 +73,7 @@ class Chef property :maximum_size, Integer, description: "Maximum size of the pagefile in megabytes." - action :set, description: "Configures the default pagefile, creating if it doesn't exist" do + action :set, description: "Configures the default pagefile, creating if it doesn't exist." do pagefile = new_resource.path initial_size = new_resource.initial_size maximum_size = new_resource.maximum_size @@ -101,7 +101,7 @@ class Chef end end - action :delete, description: "Deletes the specified pagefile" do + action :delete, description: "Deletes the specified pagefile." do validate_name delete(new_resource.path) if exists?(new_resource.path) end diff --git a/lib/chef/resource/windows_path.rb b/lib/chef/resource/windows_path.rb index 45077f74af..625ac01fd0 100644 --- a/lib/chef/resource/windows_path.rb +++ b/lib/chef/resource/windows_path.rb @@ -64,7 +64,7 @@ class Chef end end - action :add, description: "Add an item to the system path" do + action :add, description: "Add an item to the system path." do # The windows Env provider does not correctly expand variables in # the PATH environment variable. Ruby expects these to be expanded. # @@ -76,7 +76,7 @@ class Chef end end - action :remove, description: "Remove an item from the system path" do + action :remove, description: "Remove an item from the system path." do # The windows Env provider does not correctly expand variables in # the PATH environment variable. Ruby expects these to be expanded. # diff --git a/lib/chef/resource/windows_printer.rb b/lib/chef/resource/windows_printer.rb index eba18d7c38..c8d869b6b4 100644 --- a/lib/chef/resource/windows_printer.rb +++ b/lib/chef/resource/windows_printer.rb @@ -90,9 +90,7 @@ class Chef name new_resource.name end - action :create, description: "Create a new printer and printer port, if one doesn't already" do - description "Create a new printer and a printer port if one doesn't already exist." - + action :create, description: "Create a new printer and printer port, if one doesn't already." do if printer_exists? Chef::Log.info "#{@new_resource} already exists - nothing to do." else @@ -103,8 +101,6 @@ class Chef end action :delete, description: "Delete an existing printer. Note that this resource does not delete the associated printer port." do - description "Delete an existing printer. Note this does not delete the associated printer port." - if printer_exists? converge_by("Delete #{@new_resource}") do delete_printer diff --git a/lib/chef/resource/windows_printer_port.rb b/lib/chef/resource/windows_printer_port.rb index cd8b94eca9..ae58ed3c6c 100644 --- a/lib/chef/resource/windows_printer_port.rb +++ b/lib/chef/resource/windows_printer_port.rb @@ -95,9 +95,7 @@ class Chef port_name new_resource.port_name || "IP_#{new_resource.ipv4_address}" end - action :create, description: "Create the printer port, if one doesn't already exist" do - description "Create the new printer port if it does not already exist." - + action :create, description: "Create the printer port, if one doesn't already exist." do if port_exists? Chef::Log.info "#{@new_resource} already exists - nothing to do." else @@ -107,9 +105,7 @@ class Chef end end - action :delete, description: "Delete an existing printer port" do - description "Delete an existing printer port." - + action :delete, description: "Delete an existing printer port." do if port_exists? converge_by("Delete #{@new_resource}") do delete_printer_port diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb index d6f1bbbf9d..32b6b9f4a0 100644 --- a/lib/chef/resource/windows_share.rb +++ b/lib/chef/resource/windows_share.rb @@ -192,7 +192,7 @@ class Chef name end - action :create, description: "Create or modify a Windows share" do + action :create, description: "Create or modify a Windows share." do # we do this here instead of requiring the property because :delete doesn't need path set raise "No path property set" unless new_resource.path @@ -216,7 +216,7 @@ class Chef end end - action :delete, description: "Delete an existing Windows share" do + action :delete, description: "Delete an existing Windows share." do if current_resource.nil? Chef::Log.debug("#{new_resource.share_name} does not exist - nothing to do") else diff --git a/lib/chef/resource/windows_shortcut.rb b/lib/chef/resource/windows_shortcut.rb index b2de53e576..d432f41bca 100644 --- a/lib/chef/resource/windows_shortcut.rb +++ b/lib/chef/resource/windows_shortcut.rb @@ -69,7 +69,7 @@ class Chef iconlocation(link.IconLocation) end - action :create, description: "Create or modify a Windows shortcut" do + action :create, description: "Create or modify a Windows shortcut." do converge_if_changed do converge_by "creating shortcut #{new_resource.shortcut_name}" do link = WIN32OLE.new("WScript.Shell").CreateShortcut(new_resource.shortcut_name) diff --git a/lib/chef/resource/windows_uac.rb b/lib/chef/resource/windows_uac.rb index 5104b035b9..330a6432bc 100644 --- a/lib/chef/resource/windows_uac.rb +++ b/lib/chef/resource/windows_uac.rb @@ -72,9 +72,7 @@ class Chef equal_to: %i{auto_deny secure_prompt_for_creds prompt_for_creds}, default: :prompt_for_creds - action :configure, description: "Configures UAC by setting registry keys at `HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System`" do - description 'Configures UAC by setting registry keys at \'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\'' - + action :configure, description: "Configures UAC by setting registry keys at `HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System`." do registry_key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' do values [{ name: "EnableLUA", type: :dword, data: bool_to_reg(new_resource.enable_uac) }, { name: "ValidateAdminCodeSignatures", type: :dword, data: bool_to_reg(new_resource.require_signed_binaries) }, diff --git a/lib/chef/resource/windows_user_privilege.rb b/lib/chef/resource/windows_user_privilege.rb index cd106ab58b..36dd730f64 100644 --- a/lib/chef/resource/windows_user_privilege.rb +++ b/lib/chef/resource/windows_user_privilege.rb @@ -147,7 +147,7 @@ class Chef end end - action :add, description: "Add a user privilege" do + action :add, description: "Add a user privilege." do ([*new_resource.privilege] - [*current_resource.privilege]).each do |user_right| converge_by("adding user '#{new_resource.principal}' privilege #{user_right}") do Chef::ReservedNames::Win32::Security.add_account_right(new_resource.principal, user_right) @@ -155,7 +155,7 @@ class Chef end end - action :set, description: "Set the privileges that are listed in the `privilege` property for only the users listed in the `users` property" do + action :set, description: "Set the privileges that are listed in the `privilege` property for only the users listed in the `users` property." do if new_resource.users.nil? || new_resource.users.empty? raise Chef::Exceptions::ValidationFailed, "Users are required property with set action." end |