Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 2, 2018. It is now read-only.

Catch exception when pip not already installed #6

Closed
wants to merge 2 commits into from

Conversation

lcampbell
Copy link

When pip is not already installed, current_installed_version
throws an uncaught Mixlib::ShellOut::ShellCommandFailed. It tries
to catch a Chef::Exceptions::ShellCommandFailed, but that doesn't
work. This patch makes it unconditionally return nil if an exception
occurs, so that pip can be installed properly.

There's probably a better way to fix this, but alas, I am not
well-versed in Ruby.

When pip is not already installed, `current_installed_version`
throws an uncaught `Mixlib::ShellOut::ShellCommandFailed`. It tries
to catch a `Chef::Exceptions::ShellCommandFailed`, but that doesn't
work. This patch makes it unconditionally return `nil` if an exception
occurs, so that pip can be installed properly.

There's probably a better way to fix this, but alas, I am not
well-versed in Ruby.
@lcampbell
Copy link
Author

Eugh, that else should be rescue it seems, apparently I can't run tests properly. And my server's HDD just seized up. Today is not a good day.

@jtimberman
Copy link

The rescue for 0.10.8 was resolved via COOK-1282, and is released in python cookbook v1.0.8. Thank you.

@jtimberman jtimberman closed this Aug 3, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants