chef-utils 16.10.17 → 16.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62f211d198ca5e3ab4a7e86a33bb5679f78651ff3f94364046a284799bdac6ff
4
- data.tar.gz: ee619f1dcbb20f47caf2e366bef6d552cc747d3a88bd6b2ed85dff4f3d788ee1
3
+ metadata.gz: 422365b303cc61d9ae22d9895c6aa94e0730d15268a9f315bdb75e3095f6f08d
4
+ data.tar.gz: b4940a5c92ef5ff622d4eceab3182cc02cff8ca121d35196367cf5431bb32bed
5
5
  SHA512:
6
- metadata.gz: eb5ee47a673cc987a2e3d2bff07b1a8a376acd66f38f42add836375407509166bec45dec0a36595048a3d59e71dbd3e62cb698413a12bd26add01ba8d5bfe237
7
- data.tar.gz: 9cf15493a995943360b3b367639f0e6cd197ca299d07a79ad2a769943ace4674b32c04345544db46640e257af2bfa0944cc3db35b7ea34f391ff4a610c95d63a
6
+ metadata.gz: e6b2266124c3cb070ec79ba444dbf87849d4aaea9d330661ecae8cf76b7804570ec862002fd3d4d019b55edb2e878a17c47c2a8b91d2bbe0b3444980cd405b32
7
+ data.tar.gz: e48bb6cbc3aba6199d01b86cfaf3c1d195a76a3eeb206bf2f6ff54885ce2196357096bc39c6785d66f656d03a6d0318adf39c27ad5ceda36869d4bf74b97a4c7
@@ -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.10.17"
19
+ VERSION = "16.14.1"
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.10.17
4
+ version: 16.14.1
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-02-19 00:00:00.000000000 Z
11
+ date: 2021-07-27 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