summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2019-04-25 11:11:10 -0700
committerPhil Dibowitz <phil@ipom.com>2019-04-29 11:16:20 -0700
commit9ea76290936316ce6fe2d40621581210b2006572 (patch)
tree1a8c9d00ea427a307f1c955d27581edfa9c59498 /lib/chef/provider
parentda8bc7a3a5bad59fe5f228d7d0c272ea1e2c469b (diff)
downloadchef-9ea76290936316ce6fe2d40621581210b2006572.tar.gz
Tell people what file a link is pointing at.
In the event you are managing a file `/etc/file` with a `file` resource, but it turns out to be a link to `/etc/passwd` and you are trying to figure out what overwrite `/etc/passwd`, there is no indication in the logs. Let's add one. Signed-off-by: Phil Dibowitz <phil@ipom.com>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/file.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 05522f1eb8..4f9d99db90 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -227,7 +227,7 @@ class Chef
elsif file_class.symlink?(path) && new_resource.manage_symlink_source
verify_symlink_sanity(path)
elsif file_class.symlink?(new_resource.path) && new_resource.manage_symlink_source.nil?
- logger.warn("File #{path} managed by #{new_resource} is really a symlink. Managing the source file instead.")
+ logger.warn("File #{path} managed by #{new_resource} is really a symlink (to #{file_class.realpath(new_resource.path)}). Managing the source file instead.")
logger.warn("Disable this warning by setting `manage_symlink_source true` on the resource")
logger.warn("In a future Chef release, 'manage_symlink_source' will not be enabled by default")
verify_symlink_sanity(path)