Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Knife's builtin facility to configure chef. #2

Merged
merged 2 commits into from
Dec 11, 2012

Conversation

meineerde
Copy link
Contributor

This allows to place the knife.rb in any of the supported locations, e.g. inside a chef repo.

This allows to place the knife.rb in any of the supported locations,
e.g. inside a chef repo.
@chrisa
Copy link
Contributor

chrisa commented Dec 10, 2012

Hi,

Thanks for this - it definitely makes sense to follow knife's behaviour here.

It looks like this doesn't set the knife verbosity level though, which forces the Chef log level to :debug -- is there a way to default that so that the log level is taken from knife.rb?

You can see this running the tests:

➔  bundle exec rake 
/Users/chris/.rvm/rubies/ruby-1.9.2-p320/bin/ruby -S rspec ./spec/client_spec.rb ./spec/command_spec.rb ./spec/issued_certificate_spec.rb ./spec/request_spec.rb ./spec/signing_authority_spec.rb
..DEBUG: Using configuration from /Users/chris/Projects/venda/chef/upstream-cookbooks/ssl/client-gem/spec/fixtures/chef/knife.rb
.DEBUG: Using configuration from /Users/chris/Projects/venda/chef/upstream-cookbooks/ssl/client-gem/spec/fixtures/chef/knife.rb
.DEBUG: Using configuration from /Users/chris/Projects/venda/chef/upstream-cookbooks/ssl/client-gem/spec/fixtures/chef/knife.rb
.DEBUG: Using configuration from /Users/chris/Projects/venda/chef/upstream-cookbooks/ssl/client-gem/spec/fixtures/chef/knife.rb
....................

Finished in 1.25 seconds
25 examples, 0 failures
Coverage report generated for RSpec to /Users/chris/Projects/venda/chef/upstream-cookbooks/ssl/client-gem/coverage. 192 / 297 LOC (64.65%) covered.

@meineerde
Copy link
Contributor Author

Turns out that after CHEF-2150 knife doesn't really use the chef logger anymore. Instead, in knife the log level is set on the command line by passing -V which sets the verbosity.

We have to be a bit ugly to work around the stages on which the verbosity setting is translated to an actual log_level. But given that knife is intended to be run on :error anyways with apparently no way to change that ion knife.rb, I figured it would be okay to set it fixed to :error.

@chrisa chrisa merged commit e22ee30 into VendaTech:master Dec 11, 2012
@chrisa
Copy link
Contributor

chrisa commented Dec 11, 2012

Thanks, that's great. Merged in version 1.0.3.

@werebus werebus mentioned this pull request Jul 31, 2013
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants