opscode-cookbooks/python — pull request #46 by srodrig0209 (2013-06-25 19:37:36+00:00)
Title: Call apt recipe before installing python packages on debian systems

I know the typical solution to this is to "just add the recipe to your role before X" but the python cookbook should be able to stand on its own.

Without `apt` called before this, and other, cookbooks, the output is:
```ruby
[2013-06-25T18:37:47+00:00] INFO: Processing package[python] action install (python::package line 40)
[2013-06-25T18:37:47+00:00] INFO: Processing package[python-dev] action install (python::package line 40)

================================================================================
Error executing action `install` on resource 'package[python-dev]'
================================================================================

Chef::Exceptions::Exec
----------------------
apt-get -q -y install python-dev=2.7.3-0ubuntu2 returned 100, expected 0

Resource Declaration:
---------------------
# In /srv/chef/file_store/cookbooks/python/recipes/package.rb

40: package pkg do
41: action :install
42: end
43: end

Compiled Resource:
------------------
# Declared in /srv/chef/file_store/cookbooks/python/recipes/package.rb:40:in `block in from_file'

package("python-dev") do
action [:install]
retries 0
retry_delay 2
package_name "python-dev"
version "2.7.3-0ubuntu2"
cookbook_name "python"
recipe_name "package"
end

[2013-06-25T18:37:52+00:00] INFO: Running queued delayed notifications before re-raising exception
[2013-06-25T18:37:52+00:00] ERROR: Running exception handlers
[2013-06-25T18:37:53+00:00] FATAL: Saving node information to /srv/chef/file_store/failed-run-data.json
[2013-06-25T18:37:53+00:00] ERROR: Exception handlers complete
[2013-06-25T18:37:53+00:00] FATAL: Stacktrace dumped to /srv/chef/file_store/chef-stacktrace.out
[2013-06-25T18:37:53+00:00] FATAL: Chef::Exceptions::Exec: package[python-dev] (python::package line 40) had an error: Chef::Exceptions::Exec: apt-get -q -y install python-dev=2.7.3-0ubuntu2 returned 100, expected 0
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
```

I'm surprised this hasn't been pull requested before (at least, not from what I've seen thus far).