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

Improve logging and comments for attributes #89

merged 1 commit into from Sep 6, 2016


None yet
4 participants

alexpop commented Sep 5, 2016

Method retrieve_access_token is not providing any logging if it fails to get an access token. This provides misleading error messages like:

 Recipe: audit::default
   * ruby_block[exchange_refresh_token] action run
     - execute the ruby block exchange_refresh_token
   * directory[/tmp/kitchen/cache/compliance] action create (up to date)
   * file[/tmp/kitchen/cache/compliance/apache] action nothing (skipped due to action :nothing)
   * compliance_profile[apache] action fetch
     - load required inspec modules
     * directory[/tmp/kitchen/cache/compliance] action create (up to date)
     - create cache directory[2016-09-05T12:42:06+00:00] ERROR: 404 "Not Found" (Net::HTTPServerException)
 /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in `error!'
 /tmp/kitchen/cache/cookbooks/audit/libraries/server_api.rb:23:in `binmode_streaming_request'

This PR, logs the ERROR as part of the retrieve_access_token call.

 Recipe: audit::default
     * ruby_block[exchange_refresh_token] action run[2016-09-05T12:40:51+00:00] ERROR: Unable to get a Chef Compliance API access_token: 757: unexpected token at 'unable to trade refresh token for access token with issuer: invalid_request'

This comment has been minimized.


chris-rock commented Sep 6, 2016

Thanks @alexpop this is a great addition

@chris-rock chris-rock merged commit 135c2d4 into master Sep 6, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@chris-rock chris-rock deleted the ap/user-exp branch Sep 6, 2016

@iennae iennae removed the in progress label Sep 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment