diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2020-02-26 11:47:50 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2020-02-26 11:47:50 -0800 |
commit | cf453de40ea9e8f70069b11890d52a09d96d441a (patch) | |
tree | a4f6bf578b6a78abe9ca673e3a87a2159381c7cd /lib/chef/node.rb | |
parent | 63633cc1ddfbf79ff77e97376184e2d27b954678 (diff) | |
download | chef-cf453de40ea9e8f70069b11890d52a09d96d441a.tar.gz |
Convert the node[:platform_version] to a Chef::VersionStringlcg/platform_version_sugar
`node[:platform_version] =~ "~> 1.2"` will now just work.
This might conceivably be breaking if people are doing really weird
things by the class changing (Chef::VersionString still inherits from
String though, so it'll have to be weirdness on par with the bad
`thing.class.to_s == "Mash"` kind of comparisons that were in ohai).
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/node.rb')
-rw-r--r-- | lib/chef/node.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 1e5d3a8d59..a5bf1d9b8a 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -2,7 +2,7 @@ # Author:: Christopher Brown (<cb@chef.io>) # Author:: Christopher Walters (<cw@chef.io>) # Author:: Tim Hinderliter (<tim@chef.io>) -# Copyright:: Copyright 2008-2019, Chef Software Inc. +# Copyright:: Copyright 2008-2020, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -363,7 +363,7 @@ class Chef # FIXME(log): should be trace logger.debug("Platform is #{platform} version #{version}") automatic[:platform] = platform - automatic[:platform_version] = version + automatic[:platform_version] = Chef::VersionString.new(version) automatic[:chef_guid] = Chef::Config[:chef_guid] || ( Chef::Config[:chef_guid] = node_uuid ) automatic[:name] = name automatic[:chef_environment] = chef_environment |