diff options
author | Bryan McLellan <btm@chef.io> | 2015-11-05 16:28:39 -0500 |
---|---|---|
committer | Bryan McLellan <btm@chef.io> | 2015-11-06 10:26:48 -0500 |
commit | bd18b913954333f67dc4da4dc3f330298247b3f1 (patch) | |
tree | 0fa4d92638a6f85cdd3256b575ce70f40852d902 /lib/chef/knife.rb | |
parent | 2e09c06915ca8602223d83bf351d439d5c7e9e4f (diff) | |
download | chef-bd18b913954333f67dc4da4dc3f330298247b3f1.tar.gz |
Avoid squashing/humanizing the exception when config[:verbosity] == 2btm/knife-backtrace
We create an instance of Chef::Knife::Bootstrap in knife-ec2, but we've
already processed ARGV so we substitute and process an empty argv.
config[:verbosity] comes from Chef::Application::Knife. Normally we
merge those options with the ones from the knife subcommand in
Chef::Knife.run. Since we don't in this case, we don't set it to the
default of 0 that is specified there, leaving it nil.
We set Chef::Config[:verbosity] to config[:verbosity] in Chef::Knife#initialize
which now becomes nil.
This change makes it so we do not update Chef::Config[:verbosity] if
config[:verbosity] is nil, so that later when we rescue we don't call
humanize_exception if Chef::Config[:verbosity] is 2.
Diffstat (limited to 'lib/chef/knife.rb')
-rw-r--r-- | lib/chef/knife.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb index fed2ad4cfa..6fa29bea16 100644 --- a/lib/chef/knife.rb +++ b/lib/chef/knife.rb @@ -306,7 +306,7 @@ class Chef # copy Mixlib::CLI over so that it can be configured in knife.rb # config file - Chef::Config[:verbosity] = config[:verbosity] + Chef::Config[:verbosity] = config[:verbosity] if config[:verbosity] end def parse_options(args) |