summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Evans <jordane@osuosl.org>2015-04-22 15:30:49 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-23 11:14:09 -0700
commita2bee0c524829af7d6dc8867cc2c98c9b059e093 (patch)
tree4235ed16a8f4629f674c95e3c83cc86a1f0595da
parentf4e55af0a6e6d548bb90450c01d29e59ff44dacc (diff)
downloadchef-lcg/3263.tar.gz
use Chef::VersionConstraint::Platform in value_for_platformlcg/3263
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
-rw-r--r--lib/chef/dsl/platform_introspection.rb6
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