chef-utils 16.12.3 → 16.13.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09748eaf36c064c380d6ffa90cc1145813b652f01eb65d3f67fc8db2ad3999b3'
4
- data.tar.gz: 214a03f3540a0ef43e69e600e5abf412944cc4f8df737d843e5bff88294c5132
3
+ metadata.gz: fd977f2d68a2f68802ebb6319aeb7ead52ef03d2e10f39fbb9ed51ff270640ae
4
+ data.tar.gz: e1bdb2ea87fc4c50200093fd1932e9417bd1ea90e90b958999f9ce466cb367ef
5
5
  SHA512:
6
- metadata.gz: 0eda25202543cab86092b31d3ec57640acf19422f1c55938737cdb1018032db6c3bf282c0548867148cac261b77e2a04e721b2804c4dcf6f657c5b6d236d345c
7
- data.tar.gz: c9bafaf948e9976dd5d804c9947b244d2dc8543b007a1f58b120f8c0094d145bba3ce03f2377cc0b3d047cebf4526a713a9fc8ab0da2b6bd2aaf0b5020edb61f
6
+ metadata.gz: ce17f614dd3bf213d6645f9c9aceb12c310ac81098a288185273b9de9154dd000400e7e1775d6924e96f618ee652351ac3a63e66eab4568be23dbfc1883fde4f
7
+ data.tar.gz: be057d971dfbe2b2f65b026982a71eb465bfa064ec390163f37e9bb006c9ab1f10c2651787bcc5bfe187e618b1dfc3713864db2c106eda1b75d9e829b055f2ee
@@ -123,6 +123,21 @@ module ChefUtils
123
123
  # chef-sugar backcompat method
124
124
  alias_method :centos?, :centos_platform?
125
125
 
126
+ # Determine if the current node is CentOS Stream.
127
+ #
128
+ # @param [Chef::Node] node the node to check
129
+ # @since 16.13
130
+ #
131
+ # @return [Boolean]
132
+ #
133
+ def centos_stream_platform?(node = __getnode)
134
+ if node["os_release"]
135
+ node.dig("os_release", "name") == "CentOS Stream"
136
+ else
137
+ node.dig("lsb", "id") == "CentOSStream"
138
+ end
139
+ end
140
+
126
141
  # Determine if the current node is Oracle Linux.
127
142
  #
128
143
  # @param [Chef::Node] node the node to check
@@ -16,5 +16,5 @@
16
16
 
17
17
  module ChefUtils
18
18
  CHEFUTILS_ROOT = File.expand_path("..", __dir__)
19
- VERSION = "16.12.3"
19
+ VERSION = "16.13.16"
20
20
  end
@@ -90,13 +90,13 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
90
90
  end
91
91
 
92
92
  context "on centos6" do
93
- let(:options) { { platform: "centos", version: "6.10" } }
93
+ let(:options) { { platform: "centos", version: "6" } }
94
94
 
95
95
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel6?)
96
96
  end
97
97
 
98
98
  context "on centos7" do
99
- let(:options) { { platform: "centos", version: "7.7.1908" } }
99
+ let(:options) { { platform: "centos", version: "7" } }
100
100
 
101
101
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
102
102
  end
@@ -108,7 +108,7 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
108
108
  end
109
109
 
110
110
  context "on clearos7" do
111
- let(:options) { { platform: "clearos", version: "7.4" } }
111
+ let(:options) { { platform: "clearos", version: "7" } }
112
112
 
113
113
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
114
114
  end
@@ -156,25 +156,25 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do
156
156
  end
157
157
 
158
158
  context "on oracle6" do
159
- let(:options) { { platform: "oracle", version: "6.10" } }
159
+ let(:options) { { platform: "oracle", version: "6" } }
160
160
 
161
161
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel6?)
162
162
  end
163
163
 
164
164
  context "on oracle7" do
165
- let(:options) { { platform: "oracle", version: "7.6" } }
165
+ let(:options) { { platform: "oracle", version: "7" } }
166
166
 
167
167
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
168
168
  end
169
169
 
170
170
  context "on redhat6" do
171
- let(:options) { { platform: "redhat", version: "6.10" } }
171
+ let(:options) { { platform: "redhat", version: "6" } }
172
172
 
173
173
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel6?)
174
174
  end
175
175
 
176
176
  context "on redhat7" do
177
- let(:options) { { platform: "redhat", version: "7.6" } }
177
+ let(:options) { { platform: "redhat", version: "7" } }
178
178
 
179
179
  pf_reports_true_for(:rhel?, :rpm_based?, :fedora_derived?, :redhat_based?, :el?, :rhel7?)
180
180
  end
@@ -145,6 +145,20 @@ RSpec.describe ChefUtils::DSL::Platform do
145
145
  platform_reports_true_for(:centos?, :centos_platform?)
146
146
  end
147
147
 
148
+ context "on centos stream w/o os_release" do
149
+ let(:options) { { platform: "centos" } }
150
+ let(:node) { { "platform" => "centos", "platform_version" => "8", "platform_family" => "rhel", "os" => "linux", "lsb" => { "id" => "CentOSStream" }, "os_release" => nil } }
151
+
152
+ platform_reports_true_for(:centos?, :centos_platform?, :centos_stream_platform?)
153
+ end
154
+
155
+ context "on centos stream w/ os_release" do
156
+ let(:options) { { platform: "centos" } }
157
+ let(:node) { { "platform" => "centos", "platform_version" => "8", "platform_family" => "rhel", "os" => "linux", "os_release" => { "name" => "CentOS Stream" } } }
158
+
159
+ platform_reports_true_for(:centos?, :centos_platform?, :centos_stream_platform?)
160
+ end
161
+
148
162
  context "on clearos" do
149
163
  let(:options) { { platform: "clearos" } }
150
164
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.12.3
4
+ version: 16.13.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-03 00:00:00.000000000 Z
11
+ date: 2021-04-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.1.4
81
+ rubygems_version: 3.1.6
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Basic utility functions for Core Chef Infra development