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

fix #88

merged 2 commits into from Sep 1, 2016


None yet
4 participants

jeremymv2 commented Sep 1, 2016


This PR fixes the call to

Issues Resolved

Since Ruby 2.2.0 bundled in newer versions of chef-client, errors with:

    Error executing action `fetch` on resource 'compliance_profile[linux]'

    wrong number of arguments (given 3, expected 0..2)

    Cookbook Trace:
    /var/chef/cache/cookbooks/audit/libraries/profile.rb:64:in `new'

This is because has just ignored the 'wb+' option - not so any more.

This PR fixes how the Tempfile object is instantiated.

As documented here: will open the file with "w+" by default; then using bindmode=>true we get binary mode.

~/Devel/ChefProject/tmp$ ruby test_fileutils.rb

Frame number: 0/1

From: /Users/jmiller/Devel/ChefProject/tmp/test_fileutils.rb @ line 5 :

    1: require 'tempfile'
    2: require 'pry'
    3: tf ='foo', Dir.tmpdir, :binmode => true)
    4: binding.pry
 => 5: puts tf

[1] pry(main)> tf.binmode?
=> true
[2] pry(main)> File.writable?(tf.path)
=> true
[3] pry(main)>

[List any existing issues this PR resolves]

Check List

@chris-rock chris-rock merged commit afbcd7e into chef-cookbooks:master Sep 1, 2016

1 check passed

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

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


This comment has been minimized.


chris-rock commented Sep 1, 2016

Thanks @jeremymv2

@jeremymv2 jeremymv2 deleted the jeremymv2:fix_wrong_number_of_arguments branch Sep 1, 2016

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