chef-config 17.6.15 → 17.8.25

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: d2698d992c2723d0ef823fb493ac6122ce4e1b1a84d894f9a8665843eda27c53
4
- data.tar.gz: f965c38b631b145cfd13a192bd3fb394f96417a140c4874905d4bdf4e0314267
3
+ metadata.gz: 6ef38cbac12b91756af0268a4fb20af473602e7b7ce89c04a6965cf2d6657598
4
+ data.tar.gz: 5dd4b7f8fd4ed702e4747d9cacff788c5652944b5424f4a251bf337f4a5c9a2b
5
5
  SHA512:
6
- metadata.gz: cd6d25c4697fd6c9de573d974786c6a68b96bbe583497e55c608621d54e336c682ba6a4bb737132e930d1b8ad2c00b3c743e133354e9cc6a14bef853b4cfe73c
7
- data.tar.gz: 7e743937e28c6357fda5e2c9cfd19bc9353b4336428cf630725a9100aa949160665775435ef19f2a9108686f21736ceb6b1cb2aac91c4f3f8b1bbb1e4b8906af
6
+ metadata.gz: 6e7f2a3eb0a6f1f321a89fd720c316f7a3e71ad889572d5f639167c790926ab1e3456aac6833604ff480169a75a55828489115e683a9f40527f2e7d429afc4d7
7
+ data.tar.gz: 0f11a96931bbab034e6d288a4f63c20b39eb02e86ced12a72b63cc9d60fa3d4fa8876ea345816b3fccbea64db6e76a9f7718d04e73b3f2aef9c25b59a5d8b6b9
@@ -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.15".freeze
18
+ VERSION = "17.8.25".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.15
4
+ version: 17.8.25
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-12-01 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.15
19
+ version: 17.8.25
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.15
26
+ version: 17.8.25
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-shellout
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.2.22
161
+ rubygems_version: 3.2.32
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Chef Infra's default configuration and config loading library