bflad/chef-docker — pull request #197 by jschneiderhan (2014-07-28 19:28:17+00:00)
Title: Using platform resources instead of shelling out

Hi there. Thank you for sharing your excellent cookbook! I have been finding it very useful.

This PR is more for discussion than an actual merge candidate. I have been hitting an issue similar to #194 while trying to use the :redeploy action, and I think the problem is due to the timing between when platform resources are processed (embedded into the resource collection) vs when the shelled out commands are run. If the platform resources defined in the container provider executed immediately everything would work fine, but what I am seeing is the `docker rm` shellout executing prior to the `service` resource executing it's `:stop` action, leading to the following error:

```
==> default: [2014-07-28T18:59:18+00:00] DEBUG: Platform ubuntu version 14.04 found
==> default:
==> default: ================================================================================
==> default: Error executing action `run` on resource 'execute[rm a4117fb8ab6474f8d6d360345c96d3e13fa995175a89e7c2af2ce086232e6817]'
==> default: ================================================================================
==> default:
==> default:
==> default: Mixlib::ShellOut::ShellCommandFailed
==> default: ------------------------------------
==> default: Expected process to exit with [0], but received '1'
==> default: ---- Begin output of rm a4117fb8ab6474f8d6d360345c96d3e13fa995175a89e7c2af2ce086232e6817 ----
==> default: STDOUT:
==> default: STDERR: rm: cannot remove 'a4117fb8ab6474f8d6d360345c96d3e13fa995175a89e7c2af2ce086232e6817': No such file or directory
==> default: ---- End output of rm a4117fb8ab6474f8d6d360345c96d3e13fa995175a89e7c2af2ce086232e6817 ----
==> default: Ran rm a4117fb8ab6474f8d6d360345c96d3e13fa995175a89e7c2af2ce086232e6817 returned 1
==> default:
==> default:
```

If I replace the shellout calls with `execute` resources (as shown below) all the commands process just as the code reads and work perfectly (for my use case, it very well may have broken every other one).