diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/application.rb | 4 | ||||
-rw-r--r-- | lib/chef/application/windows_service.rb | 2 | ||||
-rw-r--r-- | lib/chef/node.rb | 21 | ||||
-rw-r--r-- | lib/chef/version.rb | 2 | ||||
-rw-r--r-- | lib/chef/whitelist.rb | 2 |
5 files changed, 14 insertions, 17 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index a63d8218f4..717d9e588b 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -132,10 +132,10 @@ class Chef config[:config_file] = config_fetcher.expanded_path if config[:config_file].nil? - logger.warn("No config file found or specified on command line, using command line options.") + logger.warn("No config file found or specified on command line. Using command line options instead.") elsif config_fetcher.config_missing? logger.warn("*****************************************") - logger.warn("Did not find config file: #{config[:config_file]}, using command line options.") + logger.warn("Did not find config file: #{config[:config_file]}. Using command line options instead.") logger.warn("*****************************************") else config_content = config_fetcher.read_config diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 3c73a4925d..de570068e3 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -313,7 +313,7 @@ class Chef end rescue Errno::ENOENT Chef::Log.warn("*****************************************") - Chef::Log.warn("Did not find config file: #{config[:config_file]}, using command line options.") + Chef::Log.warn("Did not find config file: #{config[:config_file]}. Using command line options instead.") Chef::Log.warn("*****************************************") Chef::Config.merge!(config) diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 87418b5732..2123d71068 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -455,13 +455,10 @@ class Chef # Transform the node to a Hash def to_hash - index_hash = Hash.new + index_hash = attributes.to_hash index_hash["chef_type"] = "node" index_hash["name"] = name index_hash["chef_environment"] = chef_environment - attribute.each do |key, value| - index_hash[key] = value - end index_hash["recipe"] = run_list.recipe_names if run_list.recipe_names.length > 0 index_hash["role"] = run_list.role_names if run_list.role_names.length > 0 index_hash["run_list"] = run_list.run_list_items @@ -472,10 +469,10 @@ class Chef display = {} display["name"] = name display["chef_environment"] = chef_environment - display["automatic"] = automatic_attrs - display["normal"] = normal_attrs - display["default"] = attributes.combined_default - display["override"] = attributes.combined_override + display["automatic"] = attributes.automatic.to_hash + display["normal"] = attributes.normal.to_hash + display["default"] = attributes.combined_default.to_hash + display["override"] = attributes.combined_override.to_hash display["run_list"] = run_list.run_list_items display end @@ -490,11 +487,11 @@ class Chef "name" => name, "chef_environment" => chef_environment, "json_class" => self.class.name, - "automatic" => attributes.automatic, - "normal" => attributes.normal, + "automatic" => attributes.automatic.to_hash, + "normal" => attributes.normal.to_hash, "chef_type" => "node", - "default" => attributes.combined_default, - "override" => attributes.combined_override, + "default" => attributes.combined_default.to_hash, + "override" => attributes.combined_override.to_hash, # Render correctly for run_list items so malformed json does not result "run_list" => @primary_runlist.run_list.map { |item| item.to_s }, } diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 118ec50e7f..f4b3955730 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require "chef/version_string" class Chef CHEF_ROOT = File.expand_path("../..", __FILE__) - VERSION = Chef::VersionString.new("14.12.6") + VERSION = Chef::VersionString.new("14.12.8") end # diff --git a/lib/chef/whitelist.rb b/lib/chef/whitelist.rb index 58d0bd70c6..c94ffcaed2 100644 --- a/lib/chef/whitelist.rb +++ b/lib/chef/whitelist.rb @@ -45,7 +45,7 @@ class Chef all_data = data filtered_data = new_data parts[0..-2].each do |part| - unless all_data[part] + unless all_data.key?(part) Chef::Log.warn("Could not find whitelist attribute #{item}.") return nil end |