diff options
author | Jordan Evans <jordane@osuosl.org> | 2015-04-22 15:30:49 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-24 14:40:26 -0700 |
commit | df77db0bf6614d73e8fc6bd9376258382e0abd6f (patch) | |
tree | 324193092bec075785e7dc9d0fc5d2902fb83ff1 /lib/chef/dsl | |
parent | a4ddaeffa003dd3ce3b666555797c928d28ff25e (diff) | |
download | chef-df77db0bf6614d73e8fc6bd9376258382e0abd6f.tar.gz |
use Chef::VersionConstraint::Platform in value_for_platform
Previously this was using Chef::VersionConstraint, which throws
an exception when presented with a version of the form x, where
x is a number. Since platforms can have this as a valid version,
we should use Chef::VersionConstraint::Platform
Diffstat (limited to 'lib/chef/dsl')
-rw-r--r-- | lib/chef/dsl/platform_introspection.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/dsl/platform_introspection.rb b/lib/chef/dsl/platform_introspection.rb index 2a52010a70..a6bd12d2ef 100644 --- a/lib/chef/dsl/platform_introspection.rb +++ b/lib/chef/dsl/platform_introspection.rb @@ -50,7 +50,7 @@ class Chef def value_for_node(node) platform, version = node[:platform].to_s, node[:platform_version].to_s - # Check if we match a version constraint via Chef::VersionConstraint and Chef::Version::Platform + # Check if we match a version constraint via Chef::VersionConstraint::Platform and Chef::Version::Platform matched_value = match_versions(node) if @values.key?(platform) && @values[platform].key?(version) @values[platform][version] @@ -76,11 +76,11 @@ class Chef keys = @values[platform].keys keys.each do |k| begin - if Chef::VersionConstraint.new(k).include?(node_version) + if Chef::VersionConstraint::Platform.new(k).include?(node_version) key_matches << k end rescue Chef::Exceptions::InvalidVersionConstraint => e - Chef::Log.debug "Caught InvalidVersionConstraint. This means that a key in value_for_platform cannot be interpreted as a Chef::VersionConstraint." + Chef::Log.debug "Caught InvalidVersionConstraint. This means that a key in value_for_platform cannot be interpreted as a Chef::VersionConstraint::Platform." Chef::Log.debug(e) end end |