summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorXabier de Zuazo <xabier@onddo.com>2013-02-18 11:20:08 +0100
committerBryan McLellan <btm@opscode.com>2013-04-11 13:04:33 -0700
commitc6a87f8610ab14a36185f5a5f9e20158f18f0f9b (patch)
tree55899af7535a37bca62b5d80f654bcce704d8241 /lib
parent9eefa3354b336e0230e5df27d2dd93fc3a42518f (diff)
downloadchef-c6a87f8610ab14a36185f5a5f9e20158f18f0f9b.tar.gz
[CHEF-3919] rescue from an InvalidCookbookVersion exception inside Chef::Platform when platform version cannot be parsed properly
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/platform.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/chef/platform.rb b/lib/chef/platform.rb
index f7c94072a1..b2b22a88ff 100644
--- a/lib/chef/platform.rb
+++ b/lib/chef/platform.rb
@@ -350,10 +350,14 @@ class Chef
provider_map.merge!(platforms[name_sym][:default])
end
platform_versions.each do |platform_version, provider|
- version_constraint = Chef::VersionConstraint.new(platform_version)
- if version_constraint.include?(version)
- Chef::Log.debug("Platform #{name.to_s} version #{version} found")
- provider_map.merge!(provider)
+ begin
+ version_constraint = Chef::VersionConstraint.new(platform_version)
+ if version_constraint.include?(version)
+ Chef::Log.debug("Platform #{name.to_s} version #{version} found")
+ provider_map.merge!(provider)
+ end
+ rescue Chef::Exceptions::InvalidCookbookVersion
+ Chef::Log.debug("Chef::Version::Comparable does not know how to parse the platform version")
end
end
else