summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-20 10:33:00 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-20 10:33:00 -0700
commit4d35de670c9d54ad3b672e668672ba3256e2aef8 (patch)
tree3ad96b367b944e8b692b1e4f70ce68853879a574
parent7ed6afa4cb93a056bcd652c1e9498a948f9f4a0e (diff)
parentdd75aa5d25ea9814164eac2c2cb09a8acadb6bae (diff)
downloadchef-4d35de670c9d54ad3b672e668672ba3256e2aef8.tar.gz
Merge pull request #4069 from tas50/messagingjk/coerce-nil
Improvements to log messages
-rw-r--r--lib/chef/client.rb2
-rw-r--r--lib/chef/cookbook/cookbook_version_loader.rb2
-rw-r--r--lib/chef/cookbook/remote_file_vendor.rb2
-rw-r--r--lib/chef/data_bag.rb2
-rw-r--r--lib/chef/data_bag_item.rb2
-rw-r--r--lib/chef/file_access_control/unix.rb24
-rw-r--r--lib/chef/file_content_management/deploy/cp.rb4
-rw-r--r--lib/chef/file_content_management/deploy/mv_unix.rb8
-rw-r--r--lib/chef/file_content_management/deploy/mv_windows.rb2
-rw-r--r--lib/chef/formatters/error_inspectors/compile_error_inspector.rb4
-rw-r--r--lib/chef/http/decompressor.rb4
-rw-r--r--lib/chef/knife/ssh.rb2
-rw-r--r--lib/chef/node.rb2
-rw-r--r--lib/chef/provider/execute.rb2
-rw-r--r--lib/chef/provider/package/openbsd.rb2
-rw-r--r--lib/chef/provider/package/yum.rb2
-rw-r--r--lib/chef/provider/remote_file/http.rb2
-rw-r--r--lib/chef/resource/execute.rb2
-rw-r--r--lib/chef/resource/script.rb2
-rw-r--r--lib/chef/rest.rb2
-rw-r--r--lib/chef/run_context.rb4
-rw-r--r--lib/chef/util/diff.rb4
-rw-r--r--lib/chef/win32/mutex.rb2
23 files changed, 42 insertions, 42 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index e2d76092e2..b2a00a7d01 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -273,7 +273,7 @@ class Chef
if Chef::Config[:why_run] == true
# why_run should probably be renamed to why_converge
- Chef::Log.debug("Not running controls in 'why_run' mode - this mode is used to see potential converge changes")
+ Chef::Log.debug("Not running controls in 'why-run' mode - this mode is used to see potential converge changes")
elsif Chef::Config[:audit_mode] != :disabled
audit_error = run_audits(run_context)
end
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb
index bcbfcbeec8..dbccdbc0a8 100644
--- a/lib/chef/cookbook/cookbook_version_loader.rb
+++ b/lib/chef/cookbook/cookbook_version_loader.rb
@@ -91,7 +91,7 @@ class Chef
remove_ignored_files
if empty?
- Chef::Log.warn "found a directory #{cookbook_name} in the cookbook path, but it contains no cookbook files. skipping."
+ Chef::Log.warn "Found a directory #{cookbook_name} in the cookbook path, but it contains no cookbook files. skipping."
end
@cookbook_settings
end
diff --git a/lib/chef/cookbook/remote_file_vendor.rb b/lib/chef/cookbook/remote_file_vendor.rb
index 9d895b168e..7868430227 100644
--- a/lib/chef/cookbook/remote_file_vendor.rb
+++ b/lib/chef/cookbook/remote_file_vendor.rb
@@ -69,7 +69,7 @@ class Chef
Chef::FileCache.move_to(raw_file.path, cache_filename)
else
Chef::Log.debug("Not fetching #{cache_filename}, as the cache is up to date.")
- Chef::Log.debug("current checksum: #{current_checksum}; manifest checksum: #{found_manifest_record['checksum']})")
+ Chef::Log.debug("Current checksum: #{current_checksum}; manifest checksum: #{found_manifest_record['checksum']})")
end
full_path_cache_filename = Chef::FileCache.load(cache_filename, false)
diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb
index 8475774fa1..401ba6f63f 100644
--- a/lib/chef/data_bag.rb
+++ b/lib/chef/data_bag.rb
@@ -144,7 +144,7 @@ class Chef
def save
begin
if Chef::Config[:why_run]
- Chef::Log.warn("In whyrun mode, so NOT performing data bag save.")
+ Chef::Log.warn("In why-run mode, so NOT performing data bag save.")
else
create
end
diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb
index 9f92e26c50..31c9b69330 100644
--- a/lib/chef/data_bag_item.rb
+++ b/lib/chef/data_bag_item.rb
@@ -170,7 +170,7 @@ class Chef
r = chef_server_rest
begin
if Chef::Config[:why_run]
- Chef::Log.warn("In whyrun mode, so NOT performing data bag item save.")
+ Chef::Log.warn("In why-run mode, so NOT performing data bag item save.")
else
r.put_rest("data/#{data_bag}/#{item_id}", self)
end
diff --git a/lib/chef/file_access_control/unix.rb b/lib/chef/file_access_control/unix.rb
index c53d832414..8178d5fbf2 100644
--- a/lib/chef/file_access_control/unix.rb
+++ b/lib/chef/file_access_control/unix.rb
@@ -79,18 +79,18 @@ class Chef
def should_update_owner?
if target_uid.nil?
# the user has not specified a permission on the new resource, so we never manage it with FAC
- Chef::Log.debug("found target_uid == nil, so no owner was specified on resource, not managing owner")
+ Chef::Log.debug("Found target_uid == nil, so no owner was specified on resource, not managing owner")
return false
elsif current_uid.nil?
# the user has specified a permission, and we are creating a file, so always enforce permissions
- Chef::Log.debug("found current_uid == nil, so we are creating a new file, updating owner")
+ Chef::Log.debug("Found current_uid == nil, so we are creating a new file, updating owner")
return true
elsif target_uid != current_uid
# the user has specified a permission, and it does not match the file, so fix the permission
- Chef::Log.debug("found target_uid != current_uid, updating owner")
+ Chef::Log.debug("Found target_uid != current_uid, updating owner")
return true
else
- Chef::Log.debug("found target_uid == current_uid, not updating owner")
+ Chef::Log.debug("Found target_uid == current_uid, not updating owner")
# the user has specified a permission, but it matches the file, so behave idempotently
return false
end
@@ -138,18 +138,18 @@ class Chef
def should_update_group?
if target_gid.nil?
# the user has not specified a permission on the new resource, so we never manage it with FAC
- Chef::Log.debug("found target_gid == nil, so no group was specified on resource, not managing group")
+ Chef::Log.debug("Found target_gid == nil, so no group was specified on resource, not managing group")
return false
elsif current_gid.nil?
# the user has specified a permission, and we are creating a file, so always enforce permissions
- Chef::Log.debug("found current_gid == nil, so we are creating a new file, updating group")
+ Chef::Log.debug("Found current_gid == nil, so we are creating a new file, updating group")
return true
elsif target_gid != current_gid
# the user has specified a permission, and it does not match the file, so fix the permission
- Chef::Log.debug("found target_gid != current_gid, updating group")
+ Chef::Log.debug("Found target_gid != current_gid, updating group")
return true
else
- Chef::Log.debug("found target_gid == current_gid, not updating group")
+ Chef::Log.debug("Found target_gid == current_gid, not updating group")
# the user has specified a permission, but it matches the file, so behave idempotently
return false
end
@@ -187,20 +187,20 @@ class Chef
def should_update_mode?
if target_mode.nil?
# the user has not specified a permission on the new resource, so we never manage it with FAC
- Chef::Log.debug("found target_mode == nil, so no mode was specified on resource, not managing mode")
+ Chef::Log.debug("Found target_mode == nil, so no mode was specified on resource, not managing mode")
return false
elsif current_mode.nil?
# the user has specified a permission, and we are creating a file, so always enforce permissions
- Chef::Log.debug("found current_mode == nil, so we are creating a new file, updating mode")
+ Chef::Log.debug("Found current_mode == nil, so we are creating a new file, updating mode")
return true
elsif target_mode != current_mode
# the user has specified a permission, and it does not match the file, so fix the permission
- Chef::Log.debug("found target_mode != current_mode, updating mode")
+ Chef::Log.debug("Found target_mode != current_mode, updating mode")
return true
elsif suid_bit_set? and (should_update_group? or should_update_owner?)
return true
else
- Chef::Log.debug("found target_mode == current_mode, not updating mode")
+ Chef::Log.debug("Found target_mode == current_mode, not updating mode")
# the user has specified a permission, but it matches the file, so behave idempotently
return false
end
diff --git a/lib/chef/file_content_management/deploy/cp.rb b/lib/chef/file_content_management/deploy/cp.rb
index c6b1d6cd11..ea378c2e5d 100644
--- a/lib/chef/file_content_management/deploy/cp.rb
+++ b/lib/chef/file_content_management/deploy/cp.rb
@@ -34,12 +34,12 @@ class Chef
#
class Cp
def create(file)
- Chef::Log.debug("touching #{file} to create it")
+ Chef::Log.debug("Touching #{file} to create it")
FileUtils.touch(file)
end
def deploy(src, dst)
- Chef::Log.debug("copying temporary file #{src} into place at #{dst}")
+ Chef::Log.debug("Copying temporary file #{src} into place at #{dst}")
FileUtils.cp(src, dst)
end
end
diff --git a/lib/chef/file_content_management/deploy/mv_unix.rb b/lib/chef/file_content_management/deploy/mv_unix.rb
index 758c594e50..9712486424 100644
--- a/lib/chef/file_content_management/deploy/mv_unix.rb
+++ b/lib/chef/file_content_management/deploy/mv_unix.rb
@@ -30,19 +30,19 @@ class Chef
def create(file)
# this is very simple, but it ensures that ownership and file modes take
# good defaults, in particular mode needs to obey umask on create
- Chef::Log.debug("touching #{file} to create it")
+ Chef::Log.debug("Touching #{file} to create it")
FileUtils.touch(file)
end
def deploy(src, dst)
# we are only responsible for content so restore the dst files perms
- Chef::Log.debug("reading modes from #{dst} file")
+ Chef::Log.debug("Reading modes from #{dst} file")
stat = ::File.stat(dst)
mode = stat.mode & 07777
uid = stat.uid
gid = stat.gid
- Chef::Log.debug("applying mode = #{mode.to_s(8)}, uid = #{uid}, gid = #{gid} to #{src}")
+ Chef::Log.debug("Applying mode = #{mode.to_s(8)}, uid = #{uid}, gid = #{gid} to #{src}")
# i own the inode, so should be able to at least chmod it
::File.chmod(mode, src)
@@ -67,7 +67,7 @@ class Chef
Chef::Log.warn("Could not set gid = #{gid} on #{src}, file modes not preserved")
end
- Chef::Log.debug("moving temporary file #{src} into place at #{dst}")
+ Chef::Log.debug("Moving temporary file #{src} into place at #{dst}")
FileUtils.mv(src, dst)
end
end
diff --git a/lib/chef/file_content_management/deploy/mv_windows.rb b/lib/chef/file_content_management/deploy/mv_windows.rb
index 0d16da9717..e2951dba4c 100644
--- a/lib/chef/file_content_management/deploy/mv_windows.rb
+++ b/lib/chef/file_content_management/deploy/mv_windows.rb
@@ -35,7 +35,7 @@ class Chef
ACL = Security::ACL
def create(file)
- Chef::Log.debug("touching #{file} to create it")
+ Chef::Log.debug("Touching #{file} to create it")
FileUtils.touch(file)
end
diff --git a/lib/chef/formatters/error_inspectors/compile_error_inspector.rb b/lib/chef/formatters/error_inspectors/compile_error_inspector.rb
index 3c22d2e763..621fadce40 100644
--- a/lib/chef/formatters/error_inspectors/compile_error_inspector.rb
+++ b/lib/chef/formatters/error_inspectors/compile_error_inspector.rb
@@ -108,7 +108,7 @@ class Chef
def culprit_backtrace_entry
@culprit_backtrace_entry ||= begin
bt_entry = filtered_bt.first
- Chef::Log.debug("backtrace entry for compile error: '#{bt_entry}'")
+ Chef::Log.debug("Backtrace entry for compile error: '#{bt_entry}'")
bt_entry
end
end
@@ -138,7 +138,7 @@ class Chef
begin
filters = Array(Chef::Config.cookbook_path).map {|p| /^#{Regexp.escape(p)}/i }
r = exception.backtrace.select {|line| filters.any? {|filter| line =~ filter }}
- Chef::Log.debug("filtered backtrace of compile error: #{r.join(",")}")
+ Chef::Log.debug("Filtered backtrace of compile error: #{r.join(",")}")
r
end
end
diff --git a/lib/chef/http/decompressor.rb b/lib/chef/http/decompressor.rb
index e1d776da60..a61f510e7d 100644
--- a/lib/chef/http/decompressor.rb
+++ b/lib/chef/http/decompressor.rb
@@ -79,10 +79,10 @@ class Chef
else
case response[CONTENT_ENCODING]
when GZIP
- Chef::Log.debug "decompressing gzip response"
+ Chef::Log.debug "Decompressing gzip response"
Zlib::Inflate.new(Zlib::MAX_WBITS + 16).inflate(response.body)
when DEFLATE
- Chef::Log.debug "decompressing deflate response"
+ Chef::Log.debug "Decompressing deflate response"
Zlib::Inflate.inflate(response.body)
else
response.body
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index d2df8399db..996f40c91d 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -467,7 +467,7 @@ class Chef
session.servers_for.each do |server|
cssh_cmd << " #{server.user ? "#{server.user}@#{server.host}" : server.host}"
end
- Chef::Log.debug("starting cssh session with command: #{cssh_cmd}")
+ Chef::Log.debug("Starting cssh session with command: #{cssh_cmd}")
exec(cssh_cmd)
end
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index 1e4a850277..ad065cc02b 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -609,7 +609,7 @@ class Chef
# so then POST to create.
begin
if Chef::Config[:why_run]
- Chef::Log.warn("In whyrun mode, so NOT performing node save.")
+ Chef::Log.warn("In why-run mode, so NOT performing node save.")
else
chef_server_rest.put_rest("nodes/#{name}", data_for_save)
end
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index b44112c19e..c3dd3b4ee1 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -41,7 +41,7 @@ class Chef
def define_resource_requirements
# @todo: this should change to raise in some appropriate major version bump.
if creates && creates_relative? && !cwd
- Chef::Log.warn "Providing a relative path for the creates attribute without the cwd is deprecated and will be changed to fail (CHEF-3819)"
+ Chef::Log.warn "Providing a relative path for the creates attribute without the cwd is deprecated and will be changed to fail in the future (CHEF-3819)"
end
end
diff --git a/lib/chef/provider/package/openbsd.rb b/lib/chef/provider/package/openbsd.rb
index 83fc09c8ae..7a6582363e 100644
--- a/lib/chef/provider/package/openbsd.rb
+++ b/lib/chef/provider/package/openbsd.rb
@@ -111,7 +111,7 @@ class Chef
end
end
results = results.reject(&:nil?)
- Chef::Log.debug("candidate versions of '#{new_resource.package_name}' are '#{results}'")
+ Chef::Log.debug("Candidate versions of '#{new_resource.package_name}' are '#{results}'")
case results.length
when 0
[]
diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb
index 81454380a3..aff8dc9326 100644
--- a/lib/chef/provider/package/yum.rb
+++ b/lib/chef/provider/package/yum.rb
@@ -791,7 +791,7 @@ class Chef
"/usr/bin/python"
end
rescue StandardError => e
- Chef::Log.warn("An error occured attempting to determine correct python executable. Using default.")
+ Chef::Log.warn("An error occurred attempting to determine correct python executable. Using default.")
Chef::Log.debug(e)
"/usr/bin/python"
end
diff --git a/lib/chef/provider/remote_file/http.rb b/lib/chef/provider/remote_file/http.rb
index f17ab5a56d..e1f1cb2da7 100644
--- a/lib/chef/provider/remote_file/http.rb
+++ b/lib/chef/provider/remote_file/http.rb
@@ -105,7 +105,7 @@ class Chef
# case you'd end up with a tar archive (no gzip) named, e.g., foo.tgz,
# which is not what you wanted.
if uri.to_s =~ /gz$/
- Chef::Log.debug("turning gzip compression off due to filename ending in gz")
+ Chef::Log.debug("Turning gzip compression off due to filename ending in gz")
opts[:disable_gzip] = true
end
opts
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index ec669a75d3..11c4ae045c 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -102,7 +102,7 @@ class Chef
end
def path(arg=nil)
- Chef::Log.warn "'path' attribute of 'execute' is not used by any provider in Chef 11 and Chef 12. Use 'environment' attribute to configure 'PATH'. This attribute will be removed in Chef 13."
+ Chef::Log.warn "The 'path' attribute of 'execute' is not used by any provider in Chef 11 or Chef 12. Use 'environment' attribute to configure 'PATH'. This attribute will be removed in Chef 13."
set_or_return(
:path,
diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb
index 30bed367cb..5081adf918 100644
--- a/lib/chef/resource/script.rb
+++ b/lib/chef/resource/script.rb
@@ -40,7 +40,7 @@ class Chef
unless arg.nil?
# Chef-13: change this to raise if the user is trying to set a value here
Chef::Log.warn "Specifying command attribute on a script resource is a coding error, use the 'code' attribute, or the execute resource"
- Chef::Log.warn "This attribute is deprecated and must be fixed or this code will fail on Chef-13"
+ Chef::Log.warn "This attribute is deprecated and must be fixed or this code will fail on Chef 13"
end
super
end
diff --git a/lib/chef/rest.rb b/lib/chef/rest.rb
index f87cec9b76..4106a01077 100644
--- a/lib/chef/rest.rb
+++ b/lib/chef/rest.rb
@@ -166,7 +166,7 @@ class Chef
def retriable_http_request(method, url, req_body, headers)
rest_request = Chef::HTTP::HTTPRequest.new(method, url, req_body, headers)
- Chef::Log.debug("Sending HTTP Request via #{method} to #{url.host}:#{url.port}#{rest_request.path}")
+ Chef::Log.debug("Sending HTTP request via #{method} to #{url.host}:#{url.port}#{rest_request.path}")
retrying_http_errors(url) do
yield rest_request
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index b2a4b13ea4..f7ab88f7e0 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -268,7 +268,7 @@ class Chef
# @see DSL::IncludeRecipe#load_recipe
#
def load_recipe(recipe_name, current_cookbook: nil)
- Chef::Log.debug("Loading Recipe #{recipe_name} via include_recipe")
+ Chef::Log.debug("Loading recipe #{recipe_name} via include_recipe")
cookbook_name, recipe_short_name = Chef::Recipe.parse_recipe_name(recipe_name, current_cookbook: current_cookbook)
@@ -308,7 +308,7 @@ ERROR_MESSAGE
raise Chef::Exceptions::RecipeNotFound, "could not find recipe file #{recipe_file}"
end
- Chef::Log.debug("Loading Recipe File #{recipe_file}")
+ Chef::Log.debug("Loading recipe file #{recipe_file}")
recipe = Chef::Recipe.new('@recipe_files', recipe_file, self)
recipe.from_file(recipe_file)
recipe
diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb
index c2dc6e045c..b8336b5135 100644
--- a/lib/chef/util/diff.rb
+++ b/lib/chef/util/diff.rb
@@ -64,7 +64,7 @@ class Chef
def use_tempfile_if_missing(file)
tempfile = nil
unless File.exists?(file)
- Chef::Log.debug("file #{file} does not exist to diff against, using empty tempfile")
+ Chef::Log.debug("File #{file} does not exist to diff against, using empty tempfile")
tempfile = Tempfile.new("chef-diff")
file = tempfile.path
end
@@ -139,7 +139,7 @@ class Chef
return "(new content is binary, diff output suppressed)" if is_binary?(new_file)
begin
- Chef::Log.debug("running: diff -u #{old_file} #{new_file}")
+ Chef::Log.debug("Running: diff -u #{old_file} #{new_file}")
diff_str = udiff(old_file, new_file)
rescue Exception => e
diff --git a/lib/chef/win32/mutex.rb b/lib/chef/win32/mutex.rb
index f4755e9019..0d8eba1b3c 100644
--- a/lib/chef/win32/mutex.rb
+++ b/lib/chef/win32/mutex.rb
@@ -79,7 +79,7 @@ class Chef
# of the process goes away and this class is only being used
# to synchronize chef-clients runs on a node.
Chef::Log.error("Can not release mutex '#{name}'. This might cause issues \
-if the mutex is attempted to be acquired by other threads.")
+if other threads attempt to acquire the mutex.")
Chef::ReservedNames::Win32::Error.raise!
end
end