diff options
author | Phil Dibowitz <phil@ipom.com> | 2021-03-06 19:10:18 -0800 |
---|---|---|
committer | Phil Dibowitz <phil@ipom.com> | 2021-03-06 19:24:59 -0800 |
commit | a1e0630be7f505b99ecba23c1a9994809c964618 (patch) | |
tree | 103a09bed505bdf0c5b9a1e3a2c95d229c4aac54 /spec/unit/provider/package | |
parent | 228291d27b8f1827f98911b6b0192d1efe06e4a3 (diff) | |
download | chef-a1e0630be7f505b99ecba23c1a9994809c964618.tar.gz |
Move idempotency logs to debug
This was discussed in the last Chef Triage meeting.
In the great move to trace logging, which is great, idempotency check
logs moved to trace, which defeats the purpose. The goal is to keep
"internal chef" logging in trace so that when users are trying to figure
out why their cookbook isn't acting as expected they can look at debug
without having to see all the other cruft. But "here's why I didn't
install the package you said to install" is table-steaks "I'm trying to
debug my cookbook."
This moves those logs back to debug. There were a variety of cases where
logging was pretty nonstandard in other ways, but to keep this PR
scoped, I didn't change those.
I did fix a few related logging issues:
* A few warns that should have been debug in windows_task
* A few places where there was basically no logging whatsoever, I put a
few of the "I did X" logs to 'debug' (from trace). It coudl be argued
some of those should be 'info', but that's a bigger change that I
didn't want to put into this PR
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Diffstat (limited to 'spec/unit/provider/package')
-rw-r--r-- | spec/unit/provider/package/apt_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider/package/deb_spec.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb index 45d6d16229..cf50c124a9 100644 --- a/spec/unit/provider/package/apt_spec.rb +++ b/spec/unit/provider/package/apt_spec.rb @@ -579,7 +579,7 @@ describe Chef::Provider::Package::Apt do ).and_return(instance_double( Mixlib::ShellOut, stdout: "irssi" )) - expect(logger).to receive(:trace).with("#{@provider.new_resource} is already locked") + expect(logger).to receive(:debug).with("#{@provider.new_resource} is already locked") @provider.action_lock end @@ -600,7 +600,7 @@ describe Chef::Provider::Package::Apt do ).and_return(instance_double( Mixlib::ShellOut, stdout: "" )) - expect(logger).to receive(:trace).with("#{@provider.new_resource} is already unlocked") + expect(logger).to receive(:debug).with("#{@provider.new_resource} is already unlocked") @provider.action_unlock end diff --git a/spec/unit/provider/package/deb_spec.rb b/spec/unit/provider/package/deb_spec.rb index da06b2d1b6..46867fc573 100644 --- a/spec/unit/provider/package/deb_spec.rb +++ b/spec/unit/provider/package/deb_spec.rb @@ -66,7 +66,7 @@ describe Chef::Provider::Package::Deb do it "does not reconfigure the package if the package is not installed" do allow(provider).to receive(:get_current_versions).and_return(nil) allow(provider.load_current_resource).to receive(:version).and_return(nil) - expect(logger).to receive(:trace).with("apt_package[emacs] is NOT installed - nothing to do") + expect(logger).to receive(:debug).with("apt_package[emacs] is NOT installed - nothing to do") expect(provider).not_to receive(:reconfig_package) provider.run_action(:reconfig) expect(new_resource).not_to be_updated_by_last_action @@ -75,7 +75,7 @@ describe Chef::Provider::Package::Deb do it "does not reconfigure the package if no response_file is given" do allow(provider).to receive(:get_current_versions).and_return("1.0") allow(new_resource).to receive(:response_file).and_return(nil) - expect(logger).to receive(:trace).with("apt_package[emacs] no response_file provided - nothing to do") + expect(logger).to receive(:debug).with("apt_package[emacs] no response_file provided - nothing to do") expect(provider).not_to receive(:reconfig_package) provider.run_action(:reconfig) expect(new_resource).not_to be_updated_by_last_action @@ -86,7 +86,7 @@ describe Chef::Provider::Package::Deb do allow(new_resource).to receive(:response_file).and_return(true) expect(provider).to receive(:get_preseed_file).and_return(false) allow(provider).to receive(:preseed_package).and_return(false) - expect(logger).to receive(:trace).with("apt_package[emacs] preseeding has not changed - nothing to do") + expect(logger).to receive(:debug).with("apt_package[emacs] preseeding has not changed - nothing to do") expect(provider).not_to receive(:reconfig_package) provider.run_action(:reconfig) expect(new_resource).not_to be_updated_by_last_action |