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

Commit 2386a59

Browse files
committed
Catch exception when pip not already installed
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.
1 parent bb17707 commit 2386a59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎providers/pip.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def current_installed_version
126126
end
127127
p = shell_out!(version_check_cmd)
128128
p.stdout.split(delimeter)[1].strip
129-
rescue Chef::Exceptions::ShellCommandFailed
129+
else
130130
end
131131
end
132132

0 commit comments

Comments
 (0)