diff options
55 files changed, 233 insertions, 231 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9792b3e803..e9a5295dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,19 @@ <!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ --> -<!-- latest_release 16.0.280 --> -## [v16.0.280](https://github.com/chef/chef/tree/v16.0.280) (2020-05-06) +<!-- latest_release 16.0.284 --> +## [v16.0.284](https://github.com/chef/chef/tree/v16.0.284) (2020-05-07) #### Merged Pull Requests -- Fix windows_package not allowing version to be an array [#9810](https://github.com/chef/chef/pull/9810) ([tas50](https://github.com/tas50)) +- Update omnibus-software for Windows lalr1.java removal [#9815](https://github.com/chef/chef/pull/9815) ([btm](https://github.com/btm)) <!-- latest_release --> <!-- release_rollup since=16.0.275 --> ### Changes not yet released to stable #### Merged Pull Requests +- Update omnibus-software for Windows lalr1.java removal [#9815](https://github.com/chef/chef/pull/9815) ([btm](https://github.com/btm)) <!-- 16.0.284 --> +- Add ohai_hint and openssl_* testing in Test Kitchen [#9813](https://github.com/chef/chef/pull/9813) ([tas50](https://github.com/tas50)) <!-- 16.0.283 --> +- fix launchd provider for chef-16 [#9812](https://github.com/chef/chef/pull/9812) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 16.0.282 --> +- Align all our comments with the code [#9811](https://github.com/chef/chef/pull/9811) ([tas50](https://github.com/tas50)) <!-- 16.0.281 --> - Fix windows_package not allowing version to be an array [#9810](https://github.com/chef/chef/pull/9810) ([tas50](https://github.com/tas50)) <!-- 16.0.280 --> - Bump inspec-core to 4.18.111 [#9803](https://github.com/chef/chef/pull/9803) ([chef-expeditor[bot]](https://github.com/chef-expeditor[bot])) <!-- 16.0.279 --> - Pin chef-telementry to 1.0.3 to avoid ffi build breakage [#9808](https://github.com/chef/chef/pull/9808) ([tas50](https://github.com/tas50)) <!-- 16.0.278 --> diff --git a/Gemfile.lock b/Gemfile.lock index dd02713339..72fd5f03ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,12 +27,12 @@ GIT PATH remote: . specs: - chef (16.0.280) + chef (16.0.284) addressable bcrypt_pbkdf (= 1.1.0.rc1) bundler (>= 1.10) - chef-config (= 16.0.280) - chef-utils (= 16.0.280) + chef-config (= 16.0.284) + chef-utils (= 16.0.284) chef-vault chef-zero (>= 14.0.11) diff-lcs (~> 1.2, >= 1.2.4) @@ -61,12 +61,12 @@ PATH train-winrm (>= 0.2.5) tty-screen (~> 0.6) uuidtools (~> 2.1.5) - chef (16.0.280-universal-mingw32) + chef (16.0.284-universal-mingw32) addressable bcrypt_pbkdf (= 1.1.0.rc1) bundler (>= 1.10) - chef-config (= 16.0.280) - chef-utils (= 16.0.280) + chef-config (= 16.0.284) + chef-utils (= 16.0.284) chef-vault chef-zero (>= 14.0.11) diff-lcs (~> 1.2, >= 1.2.4) @@ -111,15 +111,15 @@ PATH PATH remote: chef-bin specs: - chef-bin (16.0.280) - chef (= 16.0.280) + chef-bin (16.0.284) + chef (= 16.0.284) PATH remote: chef-config specs: - chef-config (16.0.280) + chef-config (16.0.284) addressable - chef-utils (= 16.0.280) + chef-utils (= 16.0.284) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -128,7 +128,7 @@ PATH PATH remote: chef-utils specs: - chef-utils (16.0.280) + chef-utils (16.0.284) GEM remote: https://rubygems.org/ @@ -1 +1 @@ -16.0.280
\ No newline at end of file +16.0.284
\ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 3940eea1a7..6ba6b22078 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("../..", __FILE__) - VERSION = "16.0.280".freeze + VERSION = "16.0.284".freeze end # diff --git a/chef-config/lib/chef-config/path_helper.rb b/chef-config/lib/chef-config/path_helper.rb index 341f6f583e..bba639245e 100644 --- a/chef-config/lib/chef-config/path_helper.rb +++ b/chef-config/lib/chef-config/path_helper.rb @@ -268,7 +268,7 @@ module ChefConfig # Determine if the given path is protected by macOS System Integrity Protection. def self.is_sip_path?(path, node) if ChefUtils.macos? - # @todo: parse rootless.conf for this? + # @todo: parse rootless.conf for this? sip_paths = [ "/System", "/bin", "/sbin", "/usr" ] diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 268188ea28..0bc58e244c 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -15,5 +15,5 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__) - VERSION = "16.0.280".freeze + VERSION = "16.0.284".freeze end diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb index 874e3a48c4..5cf814e7b3 100644 --- a/chef-config/spec/unit/config_spec.rb +++ b/chef-config/spec/unit/config_spec.rb @@ -186,29 +186,29 @@ RSpec.describe ChefConfig::Config do end describe "when configuring formatters" do - # if TTY and not(force-logger) - # formatter = configured formatter or default formatter - # formatter goes to STDOUT/ERR - # if log file is writeable - # log level is configured level or info - # log location is file - # else - # log level is warn - # log location is STDERR - # end - # elsif not(TTY) and force formatter - # formatter = configured formatter or default formatter - # if log_location specified - # formatter goes to log_location - # else - # formatter goes to STDOUT/ERR - # end - # else - # formatter = "null" - # log_location = configured-value or defualt - # log_level = info or defualt - # end - # + # if TTY and not(force-logger) + # formatter = configured formatter or default formatter + # formatter goes to STDOUT/ERR + # if log file is writeable + # log level is configured level or info + # log location is file + # else + # log level is warn + # log location is STDERR + # end + # elsif not(TTY) and force formatter + # formatter = configured formatter or default formatter + # if log_location specified + # formatter goes to log_location + # else + # formatter goes to STDOUT/ERR + # end + # else + # formatter = "null" + # log_location = configured-value or defualt + # log_level = info or defualt + # end + # it "has an empty list of formatters by default" do expect(ChefConfig::Config.formatters).to eq([]) end diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index d7b9b219dc..99acb80ffe 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -15,5 +15,5 @@ module ChefUtils CHEFUTILS_ROOT = File.expand_path("../..", __FILE__) - VERSION = "16.0.280".freeze + VERSION = "16.0.284".freeze end diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb index 7267f4ecfa..33a8a97f5b 100644 --- a/lib/chef/application/apply.rb +++ b/lib/chef/application/apply.rb @@ -232,7 +232,7 @@ class Chef::Application::Apply < Chef::Application Chef::Application.fatal!("#{e.class}: #{e.message}", e) end - # Get this party started + # Get this party started def run(enforce_license = false) reconfigure check_license_acceptance if enforce_license diff --git a/lib/chef/application/exit_code.rb b/lib/chef/application/exit_code.rb index fb1519e573..3235bfadeb 100644 --- a/lib/chef/application/exit_code.rb +++ b/lib/chef/application/exit_code.rb @@ -139,8 +139,8 @@ class Chef def notify_on_deprecation(message) Chef.deprecated(:exit_code, message) rescue Chef::Exceptions::DeprecatedFeatureError - # Have to rescue this, otherwise this unhandled error preempts - # the current exit code assignment. + # Have to rescue this, otherwise this unhandled error preempts + # the current exit code assignment. end def non_standard_exit_code_warning(exit_code) diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb index 689ae3bf8a..8237729e89 100644 --- a/lib/chef/chef_fs/chef_fs_data_store.rb +++ b/lib/chef/chef_fs/chef_fs_data_store.rb @@ -204,7 +204,7 @@ class Chef @memory_store.create(path, name, data, *options) elsif path[0] == "cookbooks" && path.length == 2 - # Do nothing. The entry gets created when the cookbook is created. + # Do nothing. The entry gets created when the cookbook is created. # /policy_groups/GROUP/policies/NAME elsif path[0] == "policy_groups" && path[2] == "policies" @@ -724,8 +724,8 @@ class Chef path[-1] = "#{path[-1]}.json" end - # /acls/containers|nodes|... do NOT drop into the next elsif, and do - # not get .json appended + # /acls/containers|nodes|... do NOT drop into the next elsif, and do + # not get .json appended # /nodes|clients|.../x.json elsif path.length == 2 diff --git a/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb b/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb index e0d4bea665..aa6981f23c 100644 --- a/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb @@ -66,7 +66,7 @@ class Chef # } # } def children - # Grab the names of the children, append json, and make child entries + # Grab the names of the children, append json, and make child entries @children ||= begin result = [] data = root.get_json(api_path) diff --git a/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb b/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb index b60b84cb68..0a1ee83c36 100644 --- a/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb @@ -71,7 +71,7 @@ class Chef # Children are foo.json and bar.json in this case. # def children - # Grab the names of the children, append json, and make child entries + # Grab the names of the children, append json, and make child entries @children ||= root.get_json(api_path).keys.sort.map do |key| make_child_entry(key, true) end diff --git a/lib/chef/chef_fs/file_system/multiplexed_dir.rb b/lib/chef/chef_fs/file_system/multiplexed_dir.rb index 2930dd5d8c..82fa146264 100644 --- a/lib/chef/chef_fs/file_system/multiplexed_dir.rb +++ b/lib/chef/chef_fs/file_system/multiplexed_dir.rb @@ -19,7 +19,7 @@ class Chef def children result = [] seen = {} - # If multiple things have the same name, the first one wins. + # If multiple things have the same name, the first one wins. multiplexed_dirs.each do |dir| dir.children.each do |child| if seen[child.name] diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb index a4b0815185..12adb50b4c 100644 --- a/lib/chef/cookbook_version.rb +++ b/lib/chef/cookbook_version.rb @@ -358,10 +358,10 @@ class Chef # extract the preference part from the path. if manifest_record_path =~ %r{(#{Regexp.escape(segment.to_s)}/[^/]+/#{Regexp.escape(dirname)})/.+$} - # Note the specificy_dirname includes the segment and - # dirname argument as above, which is what - # preferences_for_path returns. It could be - # "files/ubuntu-9.10/dirname", for example. + # Note the specificy_dirname includes the segment and + # dirname argument as above, which is what + # preferences_for_path returns. It could be + # "files/ubuntu-9.10/dirname", for example. specificity_dirname = $1 # Record the specificity_dirname only if it's in the list of diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb index ecc589d263..9ac08f43ee 100644 --- a/lib/chef/deprecated.rb +++ b/lib/chef/deprecated.rb @@ -72,7 +72,7 @@ class Chef # Just in case someone uses a symbol in the config by mistake. silence_spec = silence_spec.to_s end - # Check for a silence by deprecation name, or by location. + # Check for a silence by deprecation name, or by location. self.class.deprecation_key == silence_spec || self.class.deprecation_id.to_s == silence_spec || "chef-#{self.class.deprecation_id}" == silence_spec.downcase || location.include?(silence_spec) end # check if this warning has been silenced by inline comment. diff --git a/lib/chef/dsl/platform_introspection.rb b/lib/chef/dsl/platform_introspection.rb index e8fe616084..794f807f23 100644 --- a/lib/chef/dsl/platform_introspection.rb +++ b/lib/chef/dsl/platform_introspection.rb @@ -168,7 +168,7 @@ class Chef has_platform end - # Implementation class for determining platform family dependent values + # Implementation class for determining platform family dependent values class PlatformFamilyDependentValue # Create a platform family dependent value object. diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index bb6c5871c6..f9c3b7bb81 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -93,12 +93,12 @@ class Chef description: "For WinRM basic authentication when using the 'ssl' auth method.", boolean: true - # This option was provided in knife bootstrap windows winrm, - # but it is ignored in knife-windows/WinrmSession, and so remains unimplemeneted here. - # option :kerberos_keytab_file, - # :short => "-T KEYTAB_FILE", - # :long => "--keytab-file KEYTAB_FILE", - # :description => "The Kerberos keytab file used for authentication" + # This option was provided in knife bootstrap windows winrm, + # but it is ignored in knife-windows/WinrmSession, and so remains unimplemeneted here. + # option :kerberos_keytab_file, + # :short => "-T KEYTAB_FILE", + # :long => "--keytab-file KEYTAB_FILE", + # :description => "The Kerberos keytab file used for authentication" option :kerberos_realm, short: "-R KERBEROS_REALM", diff --git a/lib/chef/mixin/create_path.rb b/lib/chef/mixin/create_path.rb index 6d6f66317e..26988556aa 100644 --- a/lib/chef/mixin/create_path.rb +++ b/lib/chef/mixin/create_path.rb @@ -53,14 +53,14 @@ class Chef private def create_dir(path) - # When doing multithreaded downloads into the file cache, the following - # interleaving raises an error here: - # - # thread1 thread2 - # File.directory?(create_path) <- false - # File.directory?(create_path) <- false - # Dir.mkdir(create_path) - # Dir.mkdir(create_path) <- raises Errno::EEXIST + # When doing multithreaded downloads into the file cache, the following + # interleaving raises an error here: + # + # thread1 thread2 + # File.directory?(create_path) <- false + # File.directory?(create_path) <- false + # Dir.mkdir(create_path) + # Dir.mkdir(create_path) <- raises Errno::EEXIST Chef::Log.trace("Creating directory #{path}") Dir.mkdir(path) rescue Errno::EEXIST diff --git a/lib/chef/mixin/properties.rb b/lib/chef/mixin/properties.rb index 94afa4640b..b0bccaac87 100644 --- a/lib/chef/mixin/properties.rb +++ b/lib/chef/mixin/properties.rb @@ -340,6 +340,7 @@ class Chef # can also be overridden). Exclude has priority over include, although the caller is likely better # off doing the set arithmetic themselves for explicitness. # + # ```ruby # action :doit do # # use it inside a block # file "/etc/whatever.xyz" do @@ -350,6 +351,7 @@ class Chef # r = declare_resource(:file, "etc/whatever.xyz") # r.copy_properties_from(new_resource, :owner, :group, :mode) # end + # ``` # # @param other [Object] the other object (Chef::Resource) which implements the properties API # @param includes [Array<Symbol>] splat-args list of symbols of the properties to copy. diff --git a/lib/chef/node/mixin/deep_merge_cache.rb b/lib/chef/node/mixin/deep_merge_cache.rb index 8cde5a400a..e88e079895 100644 --- a/lib/chef/node/mixin/deep_merge_cache.rb +++ b/lib/chef/node/mixin/deep_merge_cache.rb @@ -19,9 +19,9 @@ class Chef class Node module Mixin module DeepMergeCache - # Cache of deep merged values by top-level key. This is a simple hash which has keys that are the - # top-level keys of the node object, and we save the computed deep-merge for that key here. There is - # no cache of subtrees. + # Cache of deep merged values by top-level key. This is a simple hash which has keys that are the + # top-level keys of the node object, and we save the computed deep-merge for that key here. There is + # no cache of subtrees. attr_accessor :deep_merge_cache def initialize @@ -31,10 +31,10 @@ class Chef @deep_merge_cache = {} end - # Invalidate a key in the deep_merge_cache. If called with nil, or no arg, this will invalidate - # the entire deep_merge cache. In the case of the user doing node.default['foo']['bar']['baz']= - # that eventually results in a call to reset_cache('foo') here. A node.default=hash_thing call - # must invalidate the entire cache and re-deep-merge the entire node object. + # Invalidate a key in the deep_merge_cache. If called with nil, or no arg, this will invalidate + # the entire deep_merge cache. In the case of the user doing node.default['foo']['bar']['baz']= + # that eventually results in a call to reset_cache('foo') here. A node.default=hash_thing call + # must invalidate the entire cache and re-deep-merge the entire node object. def reset_cache(path = nil) if path.nil? deep_merge_cache.clear diff --git a/lib/chef/provider/launchd.rb b/lib/chef/provider/launchd.rb index fbb9307712..579a53fe03 100644 --- a/lib/chef/provider/launchd.rb +++ b/lib/chef/provider/launchd.rb @@ -36,7 +36,6 @@ class Chef label mode owner - path source session_type type @@ -44,7 +43,6 @@ class Chef def load_current_resource current_resource = Chef::Resource::Launchd.new(new_resource.name) - @path = path ? path : gen_path_from_type end def gen_path_from_type @@ -90,25 +88,16 @@ class Chef def manage_plist(action) if source - cookbook_file @path do - cookbook_name = cookbook if cookbook - name(@path) if @path - backup(backup) if backup - group(group) if group - mode(mode) if mode - owner(owner) if owner - source(source) if source + cookbook_file path do + cookbook_name = new_resource.cookbook if new_resource.cookbook + copy_properties_from(new_resource, :backup, :group, :mode, :owner, :source) action(action) only_if { manage_agent?(action) } end else - file @path do - name(@path) if @path - backup(backup) if backup - content(content) if content? - group(group) if group - mode(mode) if mode - owner(owner) if owner + file path do + copy_properties_from(new_resource, :backup, :group, :mode, :owner) + content(file_content) if file_content? action(action) only_if { manage_agent?(action) } end @@ -116,11 +105,11 @@ class Chef end def manage_service(action) + plist_path = path macosx_service label do - name(label) if label - service_name(label) if label - plist(@path) if @path - session_type(session_type) if session_type + service_name(new_resource.label) if new_resource.label + plist(plist_path) if plist_path + copy_properties_from(new_resource, :session_type) action(action) only_if { manage_agent?(action) } end @@ -155,11 +144,11 @@ class Chef end end - def content? - !!content + def file_content? + !!file_content end - def content + def file_content plist_hash = new_resource.plist_hash || gen_hash ::Plist::Emit.dump(plist_hash) unless plist_hash.nil? end @@ -215,6 +204,11 @@ class Chef memo[val] = new_resource.send(key) if new_resource.send(key) end end + + # @api private + def path + @path = new_resource.path ? new_resource.path : gen_path_from_type + end end end end diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb index 6e8663b7d4..ecd0e9e455 100644 --- a/lib/chef/provider/service/macosx.rb +++ b/lib/chef/provider/service/macosx.rb @@ -56,8 +56,10 @@ class Chef if @console_user @console_user = Etc.getpwuid(::File.stat("/dev/console").uid).name logger.trace("#{new_resource} console_user: '#{@console_user}'") - cmd = "su -l" - @base_user_cmd = cmd + "#{@console_user} -c" + + @base_user_cmd = "su -l #{@console_user} -c" + logger.trace("#{new_resource} base_user_cmd: '#{@base_user_cmd}'") + # Default LaunchAgent session should be Aqua @session_type = "Aqua" if @session_type.nil? end diff --git a/lib/chef/provider/service/simple.rb b/lib/chef/provider/service/simple.rb index 754437b4a0..0d1a9ae786 100644 --- a/lib/chef/provider/service/simple.rb +++ b/lib/chef/provider/service/simple.rb @@ -117,9 +117,9 @@ class Chef logger.trace("#{@new_resource} is running") end rescue Mixlib::ShellOut::ShellCommandFailed, SystemCallError - # ShellOut sometimes throws different types of Exceptions than ShellCommandFailed. - # Temporarily catching different types of exceptions here until we get Shellout fixed. - # TODO: Remove the line before one we get the ShellOut fix. + # ShellOut sometimes throws different types of Exceptions than ShellCommandFailed. + # Temporarily catching different types of exceptions here until we get Shellout fixed. + # TODO: Remove the line before one we get the ShellOut fix. @status_load_success = false @current_resource.running false nil diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb index 598e6f8e60..ff0d338b48 100644 --- a/lib/chef/provider/windows_task.rb +++ b/lib/chef/provider/windows_task.rb @@ -424,7 +424,7 @@ class Chef when TaskScheduler::AT_LOGON # TODO: handle option for this trigger when TaskScheduler::AT_SYSTEMSTART - # TODO: handle option for this trigger + # TODO: handle option for this trigger end end diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb index e116f8c624..f71abd8557 100644 --- a/lib/chef/resource/launchd.rb +++ b/lib/chef/resource/launchd.rb @@ -76,20 +76,20 @@ class Chef property :start_calendar_interval, [Hash, Array], description: "A Hash (similar to crontab) that defines the calendar frequency at which a job is started or an Array.", coerce: proc { |type| - # Coerce into an array of hashes to make validation easier + # Coerce into an array of hashes to make validation easier array = if type.is_a?(Array) type else [type] end - # Check to make sure that our array only has hashes + # Check to make sure that our array only has hashes unless array.all? { |obj| obj.is_a?(Hash) } error_msg = "start_calendar_interval must be a single hash or an array of hashes!" raise Chef::Exceptions::ValidationFailed, error_msg end - # Make sure the hashes don't have any incorrect keys/values + # Make sure the hashes don't have any incorrect keys/values array.each do |entry| allowed_keys = %w{Minute Hour Day Weekday Month} unless entry.keys.all? { |key| allowed_keys.include?(key) } @@ -105,7 +105,7 @@ class Chef end end - # Don't return array if we only have one entry + # Don't return array if we only have one entry if array.size == 1 array.first else diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb index acd783cade..a8158aba5e 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -62,9 +62,9 @@ class Chef desired_state: false, skip_docs: true - # coerce various ways of representing a boolean into either 0 (false) or 1 (true) - # which is what the defaults CLI expects. Why? Well defaults itself accepts a few - # different formats, but when you do a read command it all comes back as 1 or 0. + # coerce various ways of representing a boolean into either 0 (false) or 1 (true) + # which is what the defaults CLI expects. Why? Well defaults itself accepts a few + # different formats, but when you do a read command it all comes back as 1 or 0. def coerce_booleans(val) return 1 if [true, "TRUE", "1", "true", "YES", "yes"].include?(val) return 0 if [false, "FALSE", "0", "false", "NO", "no"].include?(val) diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb index f7f22856d6..f1a039267d 100644 --- a/lib/chef/resource/windows_firewall_rule.rb +++ b/lib/chef/resource/windows_firewall_rule.rb @@ -93,7 +93,7 @@ class Chef description: "The local address the firewall rule applies to." property :local_port, [String, Integer, Array], - # split various formats of comma separated lists and provide a sorted array of strings to match PS output + # split various formats of comma separated lists and provide a sorted array of strings to match PS output coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map(&:to_s) }, description: "The local port the firewall rule applies to." @@ -101,7 +101,7 @@ class Chef description: "The remote address the firewall rule applies to." property :remote_port, [String, Integer, Array], - # split various formats of comma separated lists and provide a sorted array of strings to match PS output + # split various formats of comma separated lists and provide a sorted array of strings to match PS output coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map(&:to_s) }, description: "The remote port the firewall rule applies to." diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb index 1f8586836d..10533382f9 100644 --- a/lib/chef/resource/windows_share.rb +++ b/lib/chef/resource/windows_share.rb @@ -187,8 +187,8 @@ class Chef [f_users, c_users, r_users] end -# local names are returned from Get-SmbShareAccess in the full format MACHINE\\NAME -# but users of this resource would simply say NAME so we need to strip the values for comparison + # local names are returned from Get-SmbShareAccess in the full format MACHINE\\NAME + # but users of this resource would simply say NAME so we need to strip the values for comparison def stripped_account(name) name.slice!("#{node["hostname"]}\\") name diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb index bd53744f0a..5e2aa70c47 100644 --- a/lib/chef/resource/windows_task.rb +++ b/lib/chef/resource/windows_task.rb @@ -272,16 +272,16 @@ class Chef private - ## Resource is not idempotent when day, start_day is not provided with frequency :weekly - ## we set start_day when not given by user as current date based on which we set the day property for current current date day is monday .. - ## we set the monday as the day so at next run when new_resource.day is nil and current_resource day is monday due to which udpate gets called + ## Resource is not idempotent when day, start_day is not provided with frequency :weekly + ## we set start_day when not given by user as current date based on which we set the day property for current current date day is monday .. + ## we set the monday as the day so at next run when new_resource.day is nil and current_resource day is monday due to which udpate gets called def idempotency_warning_for_frequency_weekly(day, start_day) if start_day.nil? && day.nil? logger.warn "To maintain idempotency for frequency :weekly provide start_day, start_time and day." end end - # Validate the passed value is numeric values only if it is a string + # Validate the passed value is numeric values only if it is a string def numeric_value_in_string?(val) return true if Integer(val) rescue ArgumentError @@ -307,7 +307,7 @@ class Chef end end - # returns true if frequency_modifer has values First, second, third, fourth, last, lastday + # returns true if frequency_modifer has values First, second, third, fourth, last, lastday def frequency_modifier_includes_days_of_weeks?(frequency_modifier) frequency_modifier = frequency_modifier.to_s.split(",") frequency_modifier.map! { |value| value.strip.upcase } @@ -322,7 +322,7 @@ class Chef raise ArgumentError, "Invalid value passed for `random_delay`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60')." unless numeric_value_in_string?(random_delay) end - # @todo when we drop ruby 2.3 support this should be converted to .match?() instead of =~f + # @todo when we drop ruby 2.3 support this should be converted to .match?() instead of =~f def validate_start_day(start_day, frequency) if start_day && frequency == :none raise ArgumentError, "`start_day` property is not supported with frequency: #{frequency}" @@ -334,7 +334,7 @@ class Chef end end - # @todo when we drop ruby 2.3 support this should be converted to .match?() instead of =~ + # @todo when we drop ruby 2.3 support this should be converted to .match?() instead of =~ def validate_start_time(start_time, frequency) if start_time raise ArgumentError, "`start_time` property is not supported with `frequency :none`" if frequency == :none @@ -434,7 +434,7 @@ class Chef end end - # This method returns true if day has values from 1-31 which is a days of moths and used with frequency :monthly + # This method returns true if day has values from 1-31 which is a days of moths and used with frequency :monthly def days_includes_days_of_months?(days) days.map! { |day| day.to_s.strip.downcase } (days - VALID_DAYS_OF_MONTH).empty? @@ -452,11 +452,11 @@ class Chef end end - # Converts the number of seconds to an ISO8601 duration format and returns it. - # Ref : https://github.com/arnau/ISO8601/blob/master/lib/iso8601/duration.rb#L18-L23 - # e.g. - # ISO8601::Duration.new(65707200).to_s - # returns 'PT65707200S' + # Converts the number of seconds to an ISO8601 duration format and returns it. + # Ref : https://github.com/arnau/ISO8601/blob/master/lib/iso8601/duration.rb#L18-L23 + # e.g. + # ISO8601::Duration.new(65707200).to_s + # returns 'PT65707200S' def sec_to_dur(seconds) ISO8601::Duration.new(seconds.to_i).to_s end diff --git a/lib/chef/util/dsc/lcm_output_parser.rb b/lib/chef/util/dsc/lcm_output_parser.rb index 2c052396e1..38c202a4bb 100644 --- a/lib/chef/util/dsc/lcm_output_parser.rb +++ b/lib/chef/util/dsc/lcm_output_parser.rb @@ -160,9 +160,9 @@ class Chef def self.parse_line(line) if match = line.match(/^.*?:.*?:\s*LCM:\s*\[(.*?)\](.*)/) - # If the line looks like - # What If: [machinename]: LCM: [op_action op_type] message - # extract op_action, op_type, and message + # If the line looks like + # What If: [machinename]: LCM: [op_action op_type] message + # extract op_action, op_type, and message operation, info = match.captures op_action, op_type = operation.strip.split(" ").map { |m| m.downcase.to_sym } else diff --git a/lib/chef/version.rb b/lib/chef/version.rb index c42119ecc9..ee84e19265 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("../..", __FILE__) - VERSION = Chef::VersionString.new("16.0.280") + VERSION = Chef::VersionString.new("16.0.284") end # diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb index 7aca1068e0..11a18e26d1 100644 --- a/lib/chef/win32/api/file.rb +++ b/lib/chef/win32/api/file.rb @@ -461,22 +461,22 @@ BOOL WINAPI DeviceIoControl( =end safe_attach_function :DeviceIoControl, %i{HANDLE DWORD LPVOID DWORD LPVOID DWORD LPDWORD pointer}, :BOOL -# BOOL WINAPI DeleteVolumeMountPoint( - # _In_ LPCTSTR lpszVolumeMountPoint -# ); + # BOOL WINAPI DeleteVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint + # ); safe_attach_function :DeleteVolumeMountPointW, [:LPCTSTR], :BOOL -# BOOL WINAPI SetVolumeMountPoint( - # _In_ LPCTSTR lpszVolumeMountPoint, - # _In_ LPCTSTR lpszVolumeName -# ); + # BOOL WINAPI SetVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint, + # _In_ LPCTSTR lpszVolumeName + # ); safe_attach_function :SetVolumeMountPointW, %i{LPCTSTR LPCTSTR}, :BOOL -# BOOL WINAPI GetVolumeNameForVolumeMountPoint( - # _In_ LPCTSTR lpszVolumeMountPoint, - # _Out_ LPTSTR lpszVolumeName, - # _In_ DWORD cchBufferLength -# ); + # BOOL WINAPI GetVolumeNameForVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint, + # _Out_ LPTSTR lpszVolumeName, + # _In_ DWORD cchBufferLength + # ); safe_attach_function :GetVolumeNameForVolumeMountPointW, %i{LPCTSTR LPTSTR DWORD}, :BOOL =begin @@ -538,12 +538,12 @@ BOOL WINAPI VerQueryValue( # ensures the handle is closed on exit of the block # FIXME: yard with @yield def file_search_handle(path) - # Workaround for CHEF-4419: - # Make sure paths starting with "/" has a drive letter - # assigned from the current working diretory. - # Note: With CHEF-4427 this issue will be fixed with a - # broader fix to map all the paths starting with "/" to - # SYSTEM_DRIVE on windows. + # Workaround for CHEF-4419: + # Make sure paths starting with "/" has a drive letter + # assigned from the current working diretory. + # Note: With CHEF-4427 this issue will be fixed with a + # broader fix to map all the paths starting with "/" to + # SYSTEM_DRIVE on windows. path = ::File.expand_path(path) if path.start_with? "/" path = canonical_encode_path(path) find_data = WIN32_FIND_DATA.new diff --git a/lib/chef/win32/process.rb b/lib/chef/win32/process.rb index fa3286108c..17621f8518 100644 --- a/lib/chef/win32/process.rb +++ b/lib/chef/win32/process.rb @@ -82,8 +82,8 @@ class Chef (call_succeeded != 0) && (is_64_bit_process_result.get_int(0) != 0) end - # Must have PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION rights, - # AND the PROCESS_VM_READ right + # Must have PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION rights, + # AND the PROCESS_VM_READ right def self.get_process_memory_info(handle) memory_info = PROCESS_MEMORY_COUNTERS.new unless GetProcessMemoryInfo(handle.handle, memory_info, memory_info.size) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 459bf25ea0..06bbf459a0 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -18,7 +18,7 @@ GIT GIT remote: https://github.com/chef/omnibus-software - revision: 8f4f31ca9548c18808b038975f957351ec40dfd5 + revision: aa7a7eb9f199cfa80e0bcc64ec1fdfeede11ba4b branch: master specs: omnibus-software (4.0.0) diff --git a/spec/functional/resource/user/dscl_spec.rb b/spec/functional/resource/user/dscl_spec.rb index 6a18e0fd19..462e4aaa0b 100644 --- a/spec/functional/resource/user/dscl_spec.rb +++ b/spec/functional/resource/user/dscl_spec.rb @@ -29,7 +29,7 @@ describe "Chef::Resource::User with Chef::Provider::User::Dscl provider", metada def clean_user shell_out!("/usr/bin/dscl . -delete '/Users/#{username}'") rescue Mixlib::ShellOut::ShellCommandFailed - # Raised when the user is already cleaned + # Raised when the user is already cleaned end def user_should_exist diff --git a/spec/functional/resource/user/mac_user_spec.rb b/spec/functional/resource/user/mac_user_spec.rb index 2a2a4f4eac..f383140d0a 100644 --- a/spec/functional/resource/user/mac_user_spec.rb +++ b/spec/functional/resource/user/mac_user_spec.rb @@ -29,7 +29,7 @@ describe "Chef::Resource::User with Chef::Provider::User::MacUser provider", met def clean_user shell_out!("/usr/bin/dscl . -delete '/Users/#{username}'") rescue Mixlib::ShellOut::ShellCommandFailed - # Raised when the user is already cleaned + # Raised when the user is already cleaned end def ensure_file_cache_path_exists diff --git a/spec/support/shared/functional/file_resource.rb b/spec/support/shared/functional/file_resource.rb index ac37e2c735..7547d119bb 100644 --- a/spec/support/shared/functional/file_resource.rb +++ b/spec/support/shared/functional/file_resource.rb @@ -370,7 +370,7 @@ shared_examples_for "a configured file resource" do Chef::Config[:ssl_verify_mode] = :verify_none end - # note the stripping of the drive letter from the tmpdir on windows + # note the stripping of the drive letter from the tmpdir on windows let(:backup_glob) { File.join(CHEF_SPEC_BACKUP_PATH, test_file_dir.sub(/^([A-Za-z]:)/, ""), "#{file_base}*") } # Most tests update the resource, but a few do not. We need to test that the diff --git a/spec/unit/knife/role_env_run_list_add_spec.rb b/spec/unit/knife/role_env_run_list_add_spec.rb index 3696134dd3..13a05db33e 100644 --- a/spec/unit/knife/role_env_run_list_add_spec.rb +++ b/spec/unit/knife/role_env_run_list_add_spec.rb @@ -21,8 +21,8 @@ require "spec_helper" describe Chef::Knife::RoleEnvRunListAdd do before(:each) do -# Chef::Config[:role_name] = "websimian" -# Chef::Config[:env_name] = "QA" + # Chef::Config[:role_name] = "websimian" + # Chef::Config[:env_name] = "QA" @knife = Chef::Knife::RoleEnvRunListAdd.new @knife.config = { after: nil, @@ -36,10 +36,10 @@ describe Chef::Knife::RoleEnvRunListAdd do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should have an empty default run list" do @knife.run diff --git a/spec/unit/knife/role_env_run_list_clear_spec.rb b/spec/unit/knife/role_env_run_list_clear_spec.rb index cc608c918b..d4b9625550 100644 --- a/spec/unit/knife/role_env_run_list_clear_spec.rb +++ b/spec/unit/knife/role_env_run_list_clear_spec.rb @@ -44,10 +44,10 @@ describe Chef::Knife::RoleEnvRunListClear do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_env_run_list_remove_spec.rb b/spec/unit/knife/role_env_run_list_remove_spec.rb index 9bade8fac4..7f9b41475c 100644 --- a/spec/unit/knife/role_env_run_list_remove_spec.rb +++ b/spec/unit/knife/role_env_run_list_remove_spec.rb @@ -44,10 +44,10 @@ describe Chef::Knife::RoleEnvRunListRemove do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_env_run_list_replace_spec.rb b/spec/unit/knife/role_env_run_list_replace_spec.rb index 5a3365a686..93b233efdc 100644 --- a/spec/unit/knife/role_env_run_list_replace_spec.rb +++ b/spec/unit/knife/role_env_run_list_replace_spec.rb @@ -44,10 +44,10 @@ describe Chef::Knife::RoleEnvRunListReplace do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_env_run_list_set_spec.rb b/spec/unit/knife/role_env_run_list_set_spec.rb index 52ef1010b7..d35e4dbb17 100644 --- a/spec/unit/knife/role_env_run_list_set_spec.rb +++ b/spec/unit/knife/role_env_run_list_set_spec.rb @@ -44,10 +44,10 @@ describe Chef::Knife::RoleEnvRunListSet do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_run_list_add_spec.rb b/spec/unit/knife/role_run_list_add_spec.rb index 74235a019c..6f222ee80a 100644 --- a/spec/unit/knife/role_run_list_add_spec.rb +++ b/spec/unit/knife/role_run_list_add_spec.rb @@ -21,8 +21,8 @@ require "spec_helper" describe Chef::Knife::RoleRunListAdd do before(:each) do -# Chef::Config[:role_name] = "websimian" -# Chef::Config[:env_name] = "QA" + # Chef::Config[:role_name] = "websimian" + # Chef::Config[:env_name] = "QA" @knife = Chef::Knife::RoleRunListAdd.new @knife.config = { after: nil, @@ -36,10 +36,10 @@ describe Chef::Knife::RoleRunListAdd do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should have a run list with the monkey role" do @knife.run diff --git a/spec/unit/knife/role_run_list_clear_spec.rb b/spec/unit/knife/role_run_list_clear_spec.rb index 58730d42d5..327a9979b0 100644 --- a/spec/unit/knife/role_run_list_clear_spec.rb +++ b/spec/unit/knife/role_run_list_clear_spec.rb @@ -43,10 +43,10 @@ describe Chef::Knife::RoleRunListClear do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_run_list_remove_spec.rb b/spec/unit/knife/role_run_list_remove_spec.rb index e1786d7bb6..200a559c08 100644 --- a/spec/unit/knife/role_run_list_remove_spec.rb +++ b/spec/unit/knife/role_run_list_remove_spec.rb @@ -43,10 +43,10 @@ describe Chef::Knife::RoleRunListRemove do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_run_list_replace_spec.rb b/spec/unit/knife/role_run_list_replace_spec.rb index 6335f75a16..1957403fb1 100644 --- a/spec/unit/knife/role_run_list_replace_spec.rb +++ b/spec/unit/knife/role_run_list_replace_spec.rb @@ -43,10 +43,10 @@ describe Chef::Knife::RoleRunListReplace do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/knife/role_run_list_set_spec.rb b/spec/unit/knife/role_run_list_set_spec.rb index 7733174870..06098c585e 100644 --- a/spec/unit/knife/role_run_list_set_spec.rb +++ b/spec/unit/knife/role_run_list_set_spec.rb @@ -43,10 +43,10 @@ describe Chef::Knife::RoleRunListSet do describe "run" do -# it "should display all the things" do -# @knife.run -# @role.to_json.should == 'show all the things' -# end + # it "should display all the things" do + # @knife.run + # @role.to_json.should == 'show all the things' + # end it "should load the node" do expect(Chef::Role).to receive(:load).with("will").and_return(@role) diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 2f253358f1..078e6109dc 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -678,7 +678,7 @@ describe Chef::Provider::Git do expect(@provider).to receive(:enable_submodules) expect(@provider).to receive(:add_remotes) @provider.run_action(:checkout) - # @resource.should be_updated + # @resource.should be_updated end it "should not checkout if the destination exists or is a non empty directory" do @@ -716,7 +716,7 @@ describe Chef::Provider::Git do expect(@provider).to receive(:enable_submodules) expect(@provider).to receive(:add_remotes) @provider.run_action(:sync) - # @resource.should be_updated + # @resource.should be_updated end it "does not fetch any updates if the remote revision matches the current revision" do @@ -736,7 +736,7 @@ describe Chef::Provider::Git do expect(@provider).to receive(:action_checkout) expect(@provider).not_to receive(:shell_out!) @provider.run_action(:sync) - # @resource.should be_updated + # @resource.should be_updated end it "clones the repo instead of fetching updates if the deploy directory is empty" do diff --git a/spec/unit/provider/launchd_spec.rb b/spec/unit/provider/launchd_spec.rb index 53b56b4960..69f0f315d0 100644 --- a/spec/unit/provider/launchd_spec.rb +++ b/spec/unit/provider/launchd_spec.rb @@ -131,8 +131,8 @@ describe Chef::Provider::Launchd do new_resource.program "/Library/scripts/call_mom.sh" new_resource.time_out 300 new_resource.start_calendar_interval "Hour" => 10, "Weekday" => 7 - expect(provider.content?).to be_truthy - expect(provider.content).to eql(test_plist) + expect(provider.file_content?).to be_truthy + expect(provider.file_content).to eql(test_plist) end end @@ -147,8 +147,8 @@ describe Chef::Provider::Launchd do new_resource.program "/Library/scripts/call_mom.sh" new_resource.time_out 300 new_resource.start_calendar_interval allowed - expect(provider.content?).to be_truthy - expect(provider.content).to eql(test_plist_multiple_intervals) + expect(provider.file_content?).to be_truthy + expect(provider.file_content).to eql(test_plist_multiple_intervals) end it "should allow all StartCalendarInterval keys" do @@ -162,9 +162,9 @@ describe Chef::Provider::Launchd do new_resource.program "/Library/scripts/call_mom.sh" new_resource.time_out 300 new_resource.start_calendar_interval allowed - expect(provider.content?).to be_truthy + expect(provider.file_content?).to be_truthy %w{Minute Hour Day Weekday Month}.each do |key| - expect(provider.content).to include("<key>#{key}</key>") + expect(provider.file_content).to include("<key>#{key}</key>") end end @@ -188,8 +188,8 @@ describe Chef::Provider::Launchd do describe "hash is passed" do it "should produce the test_plist content from the plist_hash property" do new_resource.plist_hash test_hash - expect(provider.content?).to be_truthy - expect(provider.content).to eql(test_plist) + expect(provider.file_content?).to be_truthy + expect(provider.file_content).to eql(test_plist) end end end diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb index 017041bc60..9554f235f3 100644 --- a/spec/unit/provider/osx_profile_spec.rb +++ b/spec/unit/provider/osx_profile_spec.rb @@ -61,8 +61,8 @@ describe Chef::Provider::OsxProfile do "ProfileVersion" => 1 }], } end - # If anything is changed within this profile, be sure to update the - # ProfileUUID in all_profiles to match the new config specific UUID + # If anything is changed within this profile, be sure to update the + # ProfileUUID in all_profiles to match the new config specific UUID let(:test_profile) do { "PayloadIdentifier" => "com.testprofile.screensaver", diff --git a/spec/unit/provider/package/msu_spec.rb b/spec/unit/provider/package/msu_spec.rb index f71bd9a775..897ae254f0 100644 --- a/spec/unit/provider/package/msu_spec.rb +++ b/spec/unit/provider/package/msu_spec.rb @@ -261,9 +261,9 @@ describe Chef::Provider::Package::Msu, :windows_only do expect(cab_files).to eql(["msu_dir/IE10-Windows6.1-KB2859903-x86.CAB"]) end -# We couldn't find any msu file with multiple cab files in it. -# So we are not 100% sure about the structure of XML file in this case -# The specs below cover 2 possible XML formats + # We couldn't find any msu file with multiple cab files in it. + # So we are not 100% sure about the structure of XML file in this case + # The specs below cover 2 possible XML formats context "handles different xml formats for multiple cab files in the msu package" do it "parses xml file with multiple <package> tags" do xml_file = File.join(CHEF_SPEC_DATA, "sample_msu2.xml") diff --git a/spec/unit/provider/service/gentoo_service_spec.rb b/spec/unit/provider/service/gentoo_service_spec.rb index f9da2a828c..99c01b595b 100644 --- a/spec/unit/provider/service/gentoo_service_spec.rb +++ b/spec/unit/provider/service/gentoo_service_spec.rb @@ -37,7 +37,7 @@ describe Chef::Provider::Service::Gentoo do allow(File).to receive(:exists?).with("/etc/runlevels/default/chef").and_return(false) allow(File).to receive(:readable?).with("/etc/runlevels/default/chef").and_return(false) end - # new test: found_enabled state + # new test: found_enabled state # describe "load_current_resource" do it "should raise Chef::Exceptions::Service if /sbin/rc-update does not exist" do diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index bc58ce6ba5..dc8619a663 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -593,14 +593,14 @@ describe Chef::ProviderResolver do "debian" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Debian ], package: [ Chef::Resource::AptPackage, Chef::Provider::Package::Apt ], - # service: [ Chef::Resource::DebianService, Chef::Provider::Service::Debian ], + # service: [ Chef::Resource::DebianService, Chef::Provider::Service::Debian ], "debian" => { "7.0" => { }, "6.0" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ], + # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ], }, "5.0" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], @@ -619,7 +619,7 @@ describe Chef::ProviderResolver do "linuxmint" => { "3.1.4" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ], + # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ], }, }, "raspbian" => { @@ -667,7 +667,7 @@ describe Chef::ProviderResolver do # TODO should be Chef::Resource::PortagePackage package: [ Chef::Resource::Package, Chef::Provider::Package::Portage ], portage_package: [ Chef::Resource::PortagePackage, Chef::Provider::Package::Portage ], - # service: [ Chef::Resource::GentooService, Chef::Provider::Service::Gentoo ], + # service: [ Chef::Resource::GentooService, Chef::Provider::Service::Gentoo ], "gentoo" => { "3.1.4" => { @@ -676,14 +676,14 @@ describe Chef::ProviderResolver do }, "rhel" => { - # service: [ Chef::Resource::SystemdService, Chef::Provider::Service::Systemd ], + # service: [ Chef::Resource::SystemdService, Chef::Provider::Service::Systemd ], package: [ Chef::Resource::DnfPackage, Chef::Provider::Package::Dnf ], ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Redhat ], %w{amazon xcp xenserver ibm_powerkvm cloudlinux parallels} => { "3.1.4" => { package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ], - # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], + # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], }, }, %w{redhat centos scientific oracle} => { @@ -692,14 +692,14 @@ describe Chef::ProviderResolver do }, "6.0" => { package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ], - # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], + # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], }, }, "fedora" => { "15.0" => { }, "14.0" => { - # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], + # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], }, }, }, @@ -761,7 +761,7 @@ describe Chef::ProviderResolver do package: [ Chef::Resource::Package, Chef::Provider::Package::Bff ], rpm_package: [ Chef::Resource::RpmPackage, Chef::Provider::Package::Rpm ], user: [ Chef::Resource::User::AixUser, Chef::Provider::User::Aix ], - # service: [ Chef::Resource::AixService, Chef::Provider::Service::Aix ], + # service: [ Chef::Resource::AixService, Chef::Provider::Service::Aix ], "aix" => { "aix" => { diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb index 6ccd5d0187..5bd7a360fb 100644 --- a/spec/unit/run_context_spec.rb +++ b/spec/unit/run_context_spec.rb @@ -138,7 +138,7 @@ describe Chef::RunContext do expect(node).to receive(:loaded_recipe).with(:ancient, "aliens") expect do run_context.include_recipe("ancient::aliens") - # In CHEF-5120, this becomes a Chef::Exceptions::MissingCookbookDependency error: + # In CHEF-5120, this becomes a Chef::Exceptions::MissingCookbookDependency error: end.to raise_error(Chef::Exceptions::CookbookNotFound) end |