Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Additionally catch ArgumentError; Fixes DataDog#79
Browse files Browse the repository at this point in the history
This ensures the cookbook is still usable even if the Python version 
string is not parsable by `Gem::Version`. This occurs with certain 
Debian/Ubuntu Python version strings like `2.7.1+`.
  • Loading branch information
schisamo authored and Niko Kurtti committed Oct 20, 2014
1 parent eeb9566 commit 9e77fd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
default['datadog']['install_base'] = Gem::Version.new(node['languages']['python']['version']) < Gem::Version.new('2.6.0')
rescue NoMethodError # nodes['languages']['python'] == nil
Chef::Log.warn 'no version of python found'
rescue ArgumentError
Chef::Log.warn "could not parse python version string: #{node['languages']['python']['version']}"
end

# Chef handler version
Expand Down

0 comments on commit 9e77fd4

Please sign in to comment.