sous-chefs / apt

Development repository for the apt cookbook
https://supermarket.chef.io/cookbooks/apt
Apache License 2.0
202 stars 266 forks source link

Apt update fails on Chef < 12.4.0 #209

Closed tas50 closed 8 years ago

tas50 commented 8 years ago

If the chef cookbook is < 12.4.0 then the shell_out! method doesn't seem to exist.

       Recipe: apt::default
         * file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing)
         * apt_update[periodic] action periodic
           * directory[/var/lib/apt/periodic] action create (up to date)
           * directory[/etc/apt/apt.conf.d] action create (up to date)
           * file[/etc/apt/apt.conf.d/15update-stamp] action create_if_missing (up to date)

           ================================================================================
           Error executing action `periodic` on resource 'apt_update[periodic]'
           ================================================================================

           NoMethodError
           -------------
           undefined method `shell_out!' for AptUpdate

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/apt/libraries/apt_update.rb:50:in `do_update'
           /tmp/kitchen/cache/cookbooks/apt/libraries/apt_update.rb:20:in `block (2 levels) in <class:AptUpdate>'
           /tmp/kitchen/cache/cookbooks/apt/libraries/apt_update.rb:19:in `block in <class:AptUpdate>'
           /tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:124:in `instance_eval'
           /tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:124:in `compile_and_converge_action'
           /tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/apt/recipes/default.rb

            37: apt_update 'periodic' do
            38:   only_if { apt_installed? }
            39: end
            40:

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/apt/recipes/default.rb:37:in `from_file'

           apt_update("periodic") do
             action [:periodic]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :apt_update
             cookbook_name "apt"
             recipe_name "default"
             only_if { #code block }
           end

       Running handlers:
       [2016-08-13T07:05:35+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2016-08-13T07:05:35+00:00] ERROR: Exception handlers complete
       [2016-08-13T07:05:35+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       Chef Client failed. 2 resources updated in 4.112655857 seconds
       [2016-08-13T07:05:35+00:00] ERROR: apt_update[periodic] (apt::default line 37) had an error: NoMethodError: undefined method `shell_out!' for AptUpdate
       [2016-08-13T07:05:37+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
tas50 commented 8 years ago

Resolved in 4.0.2