mattray/managed_chef_server-cookbook

Directory not empty error in managed_chef_server_cron.rb

Closed this issue · 0 comments

It seems to me the following code deleting the directory doesn't work if the #{crondir} is not empty. Probably need to add recursive true?

# delete crondir if archive is new/changed
directory "delete #{crondir}" do
   path crondir
   action :nothing
   subscribes :delete, "file[#{archive_check}]", :immediately
end
* directory[delete /var/chef/cache/mcs-cron] action delete
  ================================================================================
  Error executing action `delete` on resource 'directory[delete /var/chef/cache/mcs-cron]'
  ================================================================================

  Errno::ENOTEMPTY
  ----------------
  Directory not empty @ dir_s_rmdir - /var/chef/cache/mcs-cron