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
lcampbell wants to merge 2 commits intopoise:masterfrom
lcampbell:master
Closed

Catch exception when pip not already installed #6
lcampbell wants to merge 2 commits intopoise:masterfrom
lcampbell:master

Conversation

@lcampbell
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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