chef-utils 16.12.3 → 16.16.7

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: e41af1d85337b1e3563a4a10619fdc194cda8e4896a9db4e40e4dc1ff5d41d8a
4
+ data.tar.gz: 4fe87795d4b04433749b94f3e2420fef6633a109c1db09d4c3dfa665f122e9b8
5
5
  SHA512:
6
- metadata.gz: 0eda25202543cab86092b31d3ec57640acf19422f1c55938737cdb1018032db6c3bf282c0548867148cac261b77e2a04e721b2804c4dcf6f657c5b6d236d345c
7
- data.tar.gz: c9bafaf948e9976dd5d804c9947b244d2dc8543b007a1f58b120f8c0094d145bba3ce03f2377cc0b3d047cebf4526a713a9fc8ab0da2b6bd2aaf0b5020edb61f
6
+ metadata.gz: 92dba9e437110c1f53ab6bb7cc4cc007bc7d3c904a978d7d6098f32f6a3dfcfb55573cfc320acf9aaba975273ef587b1724ec44332f2db83cb59ef7e2816cfd8
7
+ data.tar.gz: e744e09827239ed2d887ff71e27904b97fc2ec941b886c6e1ec4244c5c880088ad0e8d26db3fd2236cccad511d601b7bc979f827c06c6d48907d7e1e8c51abc8
@@ -87,6 +87,11 @@ module ChefUtils
87
87
  EXEC = "chef-solo"
88
88
  end
89
89
 
90
+ class Workstation
91
+ # The suffix for Chef Workstation's /opt/chef-workstation or C:\\opscode\chef-workstation
92
+ DIR_SUFFIX = "chef-workstation"
93
+ end
94
+
90
95
  class Zero
91
96
  # chef-zero executable
92
97
  PRODUCT = "Chef Infra Zero"
@@ -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.16.7"
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.16.7
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-09-30 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