chef-config 17.6.18 → 17.7.22

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: 9d9f805dc17067907307b97b0d431a28168a071498ee6bd09181f55cf4c863f3
4
- data.tar.gz: 9010e52a7f281e6defa72dd1c537f9adccdc0b947e7a9b23723a76f99708bc6e
3
+ metadata.gz: e5ed8b08f30c0832843cb6f65184e754df43412175f7e8e8791b832a1789d776
4
+ data.tar.gz: f03dfe4de2076250ea235da89ab661464063fa5d435788f2e02d382184381f48
5
5
  SHA512:
6
- metadata.gz: 66f24661fca63bd746ead9587415e02fb856b4a643724f384e45752c814ca135309c28a66c2aa50a98cbbc8927f4877d98b899b527b05c4e994cb18d46cd0e42
7
- data.tar.gz: 6a92eb34046432e35e6c419623479e72f61d64e410f4d93df7cbf86610c1ddc5d18d308d5dce0672134ccf87b15cbff1f154a465f554acf7492737803f113529
6
+ metadata.gz: 912db29f2ccbbe90ec3e9169ea20ada94ffe0a70816af4afeafba4e4c152a4344417ee0afe853cd440dd0932cc5542cfabc55a5b22dccaf87c40bd8311965647
7
+ data.tar.gz: 21ee47419e5b8e554bcfb513e967b05a2a0d380b893f80c3209a72f76c36d550edee178d500b99d14a8b59c990e82d47492a97cfcc6b484147f49cdf46ffb30e
@@ -39,7 +39,7 @@ module ChefConfig
39
39
  Win32::Registry::KEY_READ
40
40
  end
41
41
  begin
42
- Win32::Registry::HKEY_LOCAL_MACHINE.open('System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy', reg_type) do |policy|
42
+ Win32::Registry::HKEY_LOCAL_MACHINE.open("System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy", reg_type) do |policy|
43
43
  policy["Enabled"] != 0
44
44
  end
45
45
  rescue Win32::Registry::Error
@@ -108,12 +108,14 @@ module ChefConfig
108
108
 
109
109
  # Load the target_mode config context from config, and place any valid settings into the train configuration
110
110
  tm_config = config.target_mode
111
- protocol = tm_config.protocol
112
- train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
113
- logger.trace("Using target mode options from #{ChefUtils::Dist::Infra::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
114
111
 
115
112
  # Load the credentials file, and place any valid settings into the train configuration
116
113
  credentials = load_credentials(tm_config.host)
114
+
115
+ protocol = credentials[:transport_protocol] || tm_config.protocol
116
+ train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
117
+ logger.trace("Using target mode options from #{ChefUtils::Dist::Infra::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
118
+
117
119
  if credentials
118
120
  valid_settings = credentials.select { |k| Train.options(protocol).key?(k) }
119
121
  valid_settings[:enable_password] = credentials[:enable_password] if credentials.key?(:enable_password)
@@ -126,7 +128,7 @@ module ChefConfig
126
128
  # Train handles connection retries for us
127
129
  Train.create(protocol, train_config)
128
130
  rescue SocketError => e # likely a dns failure, not caught by train
129
- e.message.replace "Error connecting to #{train_config[:target]} - #{e.message}"
131
+ e.message.replace "Error connecting to #{train_config[:target]} via #{protocol} - #{e.message}"
130
132
  raise e
131
133
  rescue Train::PluginLoadError
132
134
  logger.error("Invalid target mode protocol: #{protocol}")
@@ -335,7 +335,7 @@ module ChefConfig
335
335
  line.scan(/\s*(?>([^\s\\"]+|"([^"]*)"|'([^']*)')|(\S))(\s|\z)?/m) do |word, within_dq, within_sq, esc, sep|
336
336
 
337
337
  # Append the string with Word & Escape Character
338
- field << (word || esc.gsub(/\\(.)/, '\\1'))
338
+ field << (word || esc.gsub(/\\(.)/, "\\1"))
339
339
 
340
340
  # Re-build the field when any whitespace character or
341
341
  # End of string is encountered
@@ -15,5 +15,5 @@
15
15
 
16
16
  module ChefConfig
17
17
  CHEFCONFIG_ROOT = File.expand_path("..", __dir__)
18
- VERSION = "17.6.18".freeze
18
+ VERSION = "17.7.22".freeze
19
19
  end
@@ -65,7 +65,7 @@ RSpec.describe "ChefConfig.fips?" do
65
65
  end
66
66
 
67
67
  context "on windows", :windows_only do
68
- let(:fips_key) { 'System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy' }
68
+ let(:fips_key) { "System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy" }
69
69
  let(:win_reg_entry) { { "Enabled" => enabled } }
70
70
 
71
71
  before(:each) do
@@ -62,31 +62,31 @@ RSpec.describe ChefConfig::PathHelper do
62
62
  context "platform-specific #join behavior" do
63
63
  it "joins components on Windows when some end with unix separators" do
64
64
  expected = "C:\\foo\\bar\\baz"
65
- expect(path_helper.join('C:\\foo/', "bar", "baz", windows: true)).to eq(expected)
65
+ expect(path_helper.join("C:\\foo/", "bar", "baz", windows: true)).to eq(expected)
66
66
  end
67
67
 
68
68
  it "joins components when some end with separators" do
69
69
  expected = "C:\\foo\\bar\\baz"
70
- expect(path_helper.join('C:\\foo\\', "bar", "baz", windows: true)).to eq(expected)
70
+ expect(path_helper.join("C:\\foo\\", "bar", "baz", windows: true)).to eq(expected)
71
71
  end
72
72
 
73
73
  it "joins components when some end and start with separators" do
74
74
  expected = "C:\\foo\\bar\\baz"
75
- expect(path_helper.join('C:\\foo\\', "bar/", "/baz", windows: true)).to eq(expected)
75
+ expect(path_helper.join("C:\\foo\\", "bar/", "/baz", windows: true)).to eq(expected)
76
76
  end
77
77
 
78
78
  it "joins components that don't end in separators" do
79
79
  expected = "C:\\foo\\bar\\baz"
80
- expect(path_helper.join('C:\\foo', "bar", "baz", windows: true)).to eq(expected)
80
+ expect(path_helper.join("C:\\foo", "bar", "baz", windows: true)).to eq(expected)
81
81
  end
82
82
  end
83
83
 
84
84
  it "cleanpath changes slashes into backslashes and leaves backslashes alone" do
85
- expect(path_helper.cleanpath('/a/b\\c/d/', windows: true)).to eq('\\a\\b\\c\\d')
85
+ expect(path_helper.cleanpath("/a/b\\c/d/", windows: true)).to eq("\\a\\b\\c\\d")
86
86
  end
87
87
 
88
88
  it "cleanpath does not remove leading double backslash" do
89
- expect(path_helper.cleanpath('\\\\a/b\\c/d/', windows: true)).to eq('\\\\a\\b\\c\\d')
89
+ expect(path_helper.cleanpath("\\\\a/b\\c/d/", windows: true)).to eq("\\\\a\\b\\c\\d")
90
90
  end
91
91
  end
92
92
 
@@ -117,11 +117,11 @@ RSpec.describe ChefConfig::PathHelper do
117
117
  end
118
118
 
119
119
  it "cleanpath changes backslashes into slashes and leaves slashes alone" do
120
- expect(path_helper.cleanpath('/a/b\\c/d/', windows: false)).to eq("/a/b/c/d")
120
+ expect(path_helper.cleanpath("/a/b\\c/d/", windows: false)).to eq("/a/b/c/d")
121
121
  end
122
122
 
123
123
  it "cleanpath does not remove leading double backslash" do
124
- expect(path_helper.cleanpath('\\\\a/b\\c/d/', windows: false)).to eq("//a/b/c/d")
124
+ expect(path_helper.cleanpath("\\\\a/b\\c/d/", windows: false)).to eq("//a/b/c/d")
125
125
  end
126
126
  end
127
127
  end
@@ -139,31 +139,31 @@ RSpec.describe ChefConfig::PathHelper do
139
139
  context "platform-specific #join behavior" do
140
140
  it "joins components on Windows when some end with unix separators" do
141
141
  expected = "C:\\foo\\bar\\baz"
142
- expect(path_helper.join('C:\\foo/', "bar", "baz")).to eq(expected)
142
+ expect(path_helper.join("C:\\foo/", "bar", "baz")).to eq(expected)
143
143
  end
144
144
 
145
145
  it "joins components when some end with separators" do
146
146
  expected = "C:\\foo\\bar\\baz"
147
- expect(path_helper.join('C:\\foo\\', "bar", "baz")).to eq(expected)
147
+ expect(path_helper.join("C:\\foo\\", "bar", "baz")).to eq(expected)
148
148
  end
149
149
 
150
150
  it "joins components when some end and start with separators" do
151
151
  expected = "C:\\foo\\bar\\baz"
152
- expect(path_helper.join('C:\\foo\\', "bar/", "/baz")).to eq(expected)
152
+ expect(path_helper.join("C:\\foo\\", "bar/", "/baz")).to eq(expected)
153
153
  end
154
154
 
155
155
  it "joins components that don't end in separators" do
156
156
  expected = "C:\\foo\\bar\\baz"
157
- expect(path_helper.join('C:\\foo', "bar", "baz")).to eq(expected)
157
+ expect(path_helper.join("C:\\foo", "bar", "baz")).to eq(expected)
158
158
  end
159
159
  end
160
160
 
161
161
  it "cleanpath changes slashes into backslashes and leaves backslashes alone" do
162
- expect(path_helper.cleanpath('/a/b\\c/d/')).to eq('\\a\\b\\c\\d')
162
+ expect(path_helper.cleanpath("/a/b\\c/d/")).to eq("\\a\\b\\c\\d")
163
163
  end
164
164
 
165
165
  it "cleanpath does not remove leading double backslash" do
166
- expect(path_helper.cleanpath('\\\\a/b\\c/d/')).to eq('\\\\a\\b\\c\\d')
166
+ expect(path_helper.cleanpath("\\\\a/b\\c/d/")).to eq("\\\\a\\b\\c\\d")
167
167
  end
168
168
  end
169
169
 
@@ -198,12 +198,12 @@ RSpec.describe ChefConfig::PathHelper do
198
198
  end
199
199
 
200
200
  it "cleanpath changes backslashes into slashes and leaves slashes alone" do
201
- expect(path_helper.cleanpath('/a/b\\c/d/', windows: false)).to eq("/a/b/c/d")
201
+ expect(path_helper.cleanpath("/a/b\\c/d/", windows: false)).to eq("/a/b/c/d")
202
202
  end
203
203
 
204
204
  # NOTE: this seems a bit weird to me, but this is just the way Pathname#cleanpath works
205
205
  it "cleanpath does not remove leading double backslash" do
206
- expect(path_helper.cleanpath('\\\\a/b\\c/d/')).to eq("//a/b/c/d")
206
+ expect(path_helper.cleanpath("\\\\a/b\\c/d/")).to eq("//a/b/c/d")
207
207
  end
208
208
  end
209
209
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.6.18
4
+ version: 17.7.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-01 00:00:00.000000000 Z
11
+ date: 2021-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-utils
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 17.6.18
19
+ version: 17.7.22
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 17.6.18
26
+ version: 17.7.22
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-shellout
29
29
  requirement: !ruby/object:Gem::Requirement