[chef] Re: Issue with easy_install_package provider


Chronological Thread 
  • From: Joe Williams < >
  • To:
  • Subject: [chef] Re: Issue with easy_install_package provider
  • Date: Mon, 22 Nov 2010 20:45:09 -0800

Grig,

I happened to write that provider. I found that it is difficult to detect 
what python eggs are installed without attempting an import or scanning 
through sys.path. Currently the provider should do it in that order but it 
looks like it's exiting rather than getting rescued and trying to find it in 
the sys.path. I'll work up a patch and get back to you.

-Joe



On Nov 22, 2010, at 5:05 PM, Grig Gheorghiu wrote:

> Hi,
> 
> First my scenario:
> 
> * chef server 0.9.4
> * chef-client installed on remote node via gem install using rubygems-1.3.7.
> * remote node running Ubuntu Lucid 64-bit.
> 
> I tried to use the easy_install_package provider to install some
> Python packages. It works most of the time, but it fails for packages
> whose main module name (in terms of doing 'import pkgname') is
> different from the name of the package.
> 
> Case in point is dnspython. If you run 'easy_install dnspython', you
> need to then do 'import dns' in your code, and not 'import dnspython'.
> However, the provider tries to verify the existence of the package by
> trying 'import dnspython' and it gets an exception which stops the
> entire chef-client run.
> 
> Here is the entire traceback from chef.log:
> 
> ERROR: Running exception handlers
> ERROR: Exception handlers complete
> ERROR: Chef::Exceptions::ShellCommandFailed:Expected process to exit
> 0, but it exited with 1
> ---- Begin output of python -c "import dnspython; print dnspython.__path__" 
> ----
> STDOUT:
> STDERR: Traceback (most recent call last):
> File "<string>", line 1, in <module>
> ImportError: No module named dnspython
> ---- End output of python -c "import dnspython; print dnspython.__path__" 
> ----
> Ran python -c "import dnspython; print dnspython.__path__" returned 1
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/shell_out.rb:232:in
> `invalid!'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/shell_out.rb:218:in
> `error!'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/shell_out.rb:33:in
> `shell_out!'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package/easy_install.rb:69:in
> `load_current_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource.rb:394:in
> `run_action'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:53:in
> `run_action'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in 
> `each'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:94
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
> `call'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
> `call_iterator_block'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in
> `step'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in
> `iterate'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in
> `each_with_index'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:92:in
> `execute_each_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:84:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:268:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:171:in 
> `run'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:222:in
> `run_application'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:212:in
> `loop'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:212:in
> `run_application'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application.rb:62:in
> `run'
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/chef-client:26
> /usr/bin/chef-client:19:in `load'
> /usr/bin/chef-client:19

Name: Joseph A. Williams
Email: 

Blog: http://www.joeandmotorboat.com/
Twitter: http://twitter.com/williamsjoe




Archive powered by MHonArc 2.6.16.

§