diff options
author | Lance Albertson <lance@osuosl.org> | 2021-04-06 13:00:32 -0700 |
---|---|---|
committer | Lance Albertson <lance@osuosl.org> | 2021-04-07 15:06:55 -0700 |
commit | ebff3e7aa22d12d645db3a311a8200c2ed611d18 (patch) | |
tree | b8740216e0271718a51f96e093cf414e0ecf4d02 /chef-utils/lib/chef-utils/dsl | |
parent | 594b539c131b765a3abe161e2a4e832e75cf0db1 (diff) | |
download | chef-ebff3e7aa22d12d645db3a311a8200c2ed611d18.tar.gz |
Switch to using lsb/id node data for centos_stream_platform? helper
This simplifies the previous commit to just rely on ohai node data coming from
the lsb plugin instead of doing the work ohai is already doing. This of course
assumes that lsb_release exists on the system for it to work.
Signed-off-by: Lance Albertson <lance@osuosl.org>
Diffstat (limited to 'chef-utils/lib/chef-utils/dsl')
-rw-r--r-- | chef-utils/lib/chef-utils/dsl/platform.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/chef-utils/lib/chef-utils/dsl/platform.rb b/chef-utils/lib/chef-utils/dsl/platform.rb index c90117cb33..8dd852af3e 100644 --- a/chef-utils/lib/chef-utils/dsl/platform.rb +++ b/chef-utils/lib/chef-utils/dsl/platform.rb @@ -17,13 +17,11 @@ # require_relative "../internal" -require_relative "train_helpers" module ChefUtils module DSL module Platform include Internal - include TrainHelpers # NOTE: if you are adding new platform helpers they should all have the `_platform?` suffix. # DO NOT add new short aliases without the suffix (they will be deprecated in the future) @@ -127,12 +125,13 @@ module ChefUtils # Determine if the current node is CentOS Stream. # + # @param [Chef::Node] node the node to check # @since 17.0 # # @return [Boolean] # - def centos_stream_platform? - file_exist?("/etc/os-release") && file_read("/etc/os-release").match?("CentOS Stream") + def centos_stream_platform?(node = __getnode) + node.dig("lsb", "id") == "CentOSStream" end # Determine if the current node is Oracle Linux. |