choria-mcorpc-support 2.27.0 → 2.28.0
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 +4 -4
- data/.rubocop.yml +196 -14
- data/CHANGELOG.md +13 -0
- data/Gemfile +2 -2
- data/Rakefile +0 -1
- data/lib/mcollective/connector/nats.rb +12 -8
- data/lib/mcollective/monkey_patches.rb +10 -111
- data/lib/mcollective/pluginpackager/forge_packager.rb +1 -1
- data/lib/mcollective/rpc/client.rb +2 -1
- data/lib/mcollective/ssl.rb +9 -19
- data/lib/mcollective/util/choria.rb +1 -7
- data/lib/mcollective/util/playbook/tasks/mcollective_task.rb +3 -2
- data/lib/mcollective/util/tasks_support.rb +4 -1
- data/lib/mcollective/util.rb +2 -47
- data/lib/mcollective.rb +0 -1
- metadata +31 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e03fd0e1a3c6d5d484223581ceaedd114b5ee3e9b9a6e132216b0772ff4b11a
|
|
4
|
+
data.tar.gz: 5e7e36df4b91c182a92e78d1675a613709471ff45602b4694587340b87a93d1f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca18daa9e564e60e31b4365dac920c0544c457d2679d6c2d4035c50ffbf35c92baa95a960036523fca06c399a1aadc6d486427e1c2d489a7ec812227e6e665d9
|
|
7
|
+
data.tar.gz: 3034a4e775917aad91a4dfd5fe106d984773b724225f675705e7bf540bd7e483e367e3f7e640e4697197609bf44af909c660251e33fa251d49d85a7b3f309cdb
|
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
-
TargetRubyVersion: "
|
|
2
|
+
TargetRubyVersion: "3.4"
|
|
3
|
+
NewCops: disable
|
|
3
4
|
DisplayCopNames: true
|
|
4
5
|
DisplayStyleGuide: true
|
|
5
6
|
SuggestExtensions: false
|
|
@@ -39,9 +40,6 @@ Style/BlockDelimiters:
|
|
|
39
40
|
Style/RegexpLiteral:
|
|
40
41
|
Enabled: false
|
|
41
42
|
|
|
42
|
-
Style/StringLiterals:
|
|
43
|
-
EnforcedStyle: double_quotes
|
|
44
|
-
|
|
45
43
|
Style/FormatString:
|
|
46
44
|
EnforcedStyle: percent
|
|
47
45
|
|
|
@@ -51,9 +49,6 @@ Style/FormatStringToken:
|
|
|
51
49
|
Style/SpecialGlobalVars:
|
|
52
50
|
Enabled: false
|
|
53
51
|
|
|
54
|
-
Style/HashSyntax:
|
|
55
|
-
EnforcedStyle: hash_rockets
|
|
56
|
-
|
|
57
52
|
Style/WordArray:
|
|
58
53
|
Enabled: false
|
|
59
54
|
|
|
@@ -69,16 +64,13 @@ Style/RescueModifier:
|
|
|
69
64
|
Layout/SpaceInsideBlockBraces:
|
|
70
65
|
Enabled: false
|
|
71
66
|
|
|
72
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
73
|
-
EnforcedStyle: no_space
|
|
74
|
-
|
|
75
67
|
Style/EachWithObject:
|
|
76
68
|
Enabled: false
|
|
77
69
|
|
|
78
70
|
Style/GuardClause:
|
|
79
71
|
Enabled: false
|
|
80
72
|
|
|
81
|
-
Naming/
|
|
73
|
+
Naming/PredicatePrefix:
|
|
82
74
|
Enabled: false
|
|
83
75
|
|
|
84
76
|
Style/DoubleNegation:
|
|
@@ -106,9 +98,6 @@ Lint/UnusedMethodArgument:
|
|
|
106
98
|
Lint/AssignmentInCondition:
|
|
107
99
|
Enabled: false
|
|
108
100
|
|
|
109
|
-
Layout/LineLength:
|
|
110
|
-
Max: 180
|
|
111
|
-
|
|
112
101
|
Metrics/PerceivedComplexity:
|
|
113
102
|
Enabled: false
|
|
114
103
|
|
|
@@ -160,3 +149,196 @@ Style/OptionalBooleanParameter:
|
|
|
160
149
|
|
|
161
150
|
Naming/MemoizedInstanceVariableName:
|
|
162
151
|
Enabled: false
|
|
152
|
+
|
|
153
|
+
# Changes after update to 1.92
|
|
154
|
+
Bundler/OrderedGems:
|
|
155
|
+
Enabled: false
|
|
156
|
+
|
|
157
|
+
Gemspec/OrderedDependencies:
|
|
158
|
+
Enabled: false
|
|
159
|
+
|
|
160
|
+
Layout/ArrayAlignment:
|
|
161
|
+
Enabled: false
|
|
162
|
+
|
|
163
|
+
Layout/BlockAlignment:
|
|
164
|
+
Enabled: false
|
|
165
|
+
|
|
166
|
+
Layout/EmptyLineAfterGuardClause:
|
|
167
|
+
Enabled: false
|
|
168
|
+
|
|
169
|
+
Layout/EmptyLines:
|
|
170
|
+
Enabled: false
|
|
171
|
+
|
|
172
|
+
Layout/EmptyLinesAroundBlockBody:
|
|
173
|
+
Enabled: false
|
|
174
|
+
|
|
175
|
+
Layout/ExtraSpacing:
|
|
176
|
+
Enabled: false
|
|
177
|
+
|
|
178
|
+
Layout/FirstArrayElementIndentation:
|
|
179
|
+
Enabled: false
|
|
180
|
+
|
|
181
|
+
Layout/FirstHashElementIndentation:
|
|
182
|
+
Enabled: false
|
|
183
|
+
|
|
184
|
+
Layout/HashAlignment:
|
|
185
|
+
Enabled: false
|
|
186
|
+
|
|
187
|
+
Layout/IndentationConsistency:
|
|
188
|
+
Enabled: false
|
|
189
|
+
|
|
190
|
+
Layout/IndentationWidth:
|
|
191
|
+
Enabled: false
|
|
192
|
+
|
|
193
|
+
Layout/LineLength:
|
|
194
|
+
Enabled: false
|
|
195
|
+
|
|
196
|
+
Layout/MultilineArrayBraceLayout:
|
|
197
|
+
Enabled: false
|
|
198
|
+
|
|
199
|
+
Layout/MultilineHashBraceLayout:
|
|
200
|
+
Enabled: false
|
|
201
|
+
|
|
202
|
+
Layout/SpaceAfterColon:
|
|
203
|
+
Enabled: false
|
|
204
|
+
|
|
205
|
+
Layout/SpaceAfterComma:
|
|
206
|
+
Enabled: false
|
|
207
|
+
|
|
208
|
+
Layout/SpaceAfterSemicolon:
|
|
209
|
+
Enabled: false
|
|
210
|
+
|
|
211
|
+
Layout/SpaceAroundKeyword:
|
|
212
|
+
Enabled: false
|
|
213
|
+
|
|
214
|
+
Layout/SpaceAroundOperators:
|
|
215
|
+
Enabled: false
|
|
216
|
+
|
|
217
|
+
Layout/SpaceBeforeBlockBraces:
|
|
218
|
+
Enabled: false
|
|
219
|
+
|
|
220
|
+
Layout/SpaceBeforeComma:
|
|
221
|
+
Enabled: false
|
|
222
|
+
|
|
223
|
+
Layout/SpaceBeforeSemicolon:
|
|
224
|
+
Enabled: false
|
|
225
|
+
|
|
226
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
|
227
|
+
Enabled: false
|
|
228
|
+
|
|
229
|
+
Layout/SpaceInsideHashLiteralBraces:
|
|
230
|
+
Enabled: false
|
|
231
|
+
|
|
232
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
|
233
|
+
Enabled: false
|
|
234
|
+
|
|
235
|
+
Layout/TrailingEmptyLines:
|
|
236
|
+
Enabled: false
|
|
237
|
+
|
|
238
|
+
Lint/AmbiguousBlockAssociation:
|
|
239
|
+
Enabled: false
|
|
240
|
+
|
|
241
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
|
242
|
+
Enabled: false
|
|
243
|
+
|
|
244
|
+
Lint/ConstantDefinitionInBlock:
|
|
245
|
+
Enabled: false
|
|
246
|
+
|
|
247
|
+
Lint/CopDirectiveSyntax:
|
|
248
|
+
Enabled: false
|
|
249
|
+
|
|
250
|
+
Lint/DeprecatedClassMethods:
|
|
251
|
+
Enabled: false
|
|
252
|
+
|
|
253
|
+
Lint/RaiseException:
|
|
254
|
+
Enabled: false
|
|
255
|
+
|
|
256
|
+
Lint/RedundantCopDisableDirective:
|
|
257
|
+
Enabled: false
|
|
258
|
+
|
|
259
|
+
Lint/RedundantStringCoercion:
|
|
260
|
+
Enabled: false
|
|
261
|
+
|
|
262
|
+
Lint/ScriptPermission:
|
|
263
|
+
Enabled: false
|
|
264
|
+
|
|
265
|
+
Lint/UnusedBlockArgument:
|
|
266
|
+
Enabled: false
|
|
267
|
+
|
|
268
|
+
Lint/UselessAssignment:
|
|
269
|
+
Enabled: false
|
|
270
|
+
|
|
271
|
+
Security/JSONLoad:
|
|
272
|
+
Enabled: false
|
|
273
|
+
|
|
274
|
+
Style/ClassAndModuleChildren:
|
|
275
|
+
Enabled: false
|
|
276
|
+
|
|
277
|
+
Style/EmptyLiteral:
|
|
278
|
+
Enabled: false
|
|
279
|
+
|
|
280
|
+
Style/GlobalStdStream:
|
|
281
|
+
Enabled: false
|
|
282
|
+
|
|
283
|
+
Style/HashAsLastArrayItem:
|
|
284
|
+
Enabled: false
|
|
285
|
+
|
|
286
|
+
Style/HashEachMethods:
|
|
287
|
+
Enabled: false
|
|
288
|
+
|
|
289
|
+
Style/HashSyntax:
|
|
290
|
+
Enabled: false
|
|
291
|
+
|
|
292
|
+
Style/IfUnlessModifier:
|
|
293
|
+
Enabled: false
|
|
294
|
+
|
|
295
|
+
Style/MethodCallWithoutArgsParentheses:
|
|
296
|
+
Enabled: false
|
|
297
|
+
|
|
298
|
+
Style/MultipleComparison:
|
|
299
|
+
Enabled: false
|
|
300
|
+
|
|
301
|
+
Style/MutableConstant:
|
|
302
|
+
Enabled: false
|
|
303
|
+
|
|
304
|
+
Style/NilComparison:
|
|
305
|
+
Enabled: false
|
|
306
|
+
|
|
307
|
+
Style/PercentLiteralDelimiters:
|
|
308
|
+
Enabled: false
|
|
309
|
+
|
|
310
|
+
Style/Proc:
|
|
311
|
+
Enabled: false
|
|
312
|
+
|
|
313
|
+
Style/RedundantBegin:
|
|
314
|
+
Enabled: false
|
|
315
|
+
|
|
316
|
+
Style/RedundantCondition:
|
|
317
|
+
Enabled: false
|
|
318
|
+
|
|
319
|
+
Style/RedundantParentheses:
|
|
320
|
+
Enabled: false
|
|
321
|
+
|
|
322
|
+
Style/RedundantRegexpEscape:
|
|
323
|
+
Enabled: false
|
|
324
|
+
|
|
325
|
+
Style/RedundantSelfAssignment:
|
|
326
|
+
Enabled: false
|
|
327
|
+
|
|
328
|
+
Style/Semicolon:
|
|
329
|
+
Enabled: false
|
|
330
|
+
|
|
331
|
+
Style/SlicingWithRange:
|
|
332
|
+
Enabled: false
|
|
333
|
+
|
|
334
|
+
Style/StringConcatenation:
|
|
335
|
+
Enabled: false
|
|
336
|
+
|
|
337
|
+
Style/StringLiterals:
|
|
338
|
+
Enabled: false
|
|
339
|
+
|
|
340
|
+
Style/SymbolProc:
|
|
341
|
+
Enabled: false
|
|
342
|
+
|
|
343
|
+
Style/TrailingCommaInHashLiteral:
|
|
344
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
|Date |Issue |Description |
|
|
2
2
|
|----------|------|---------------------------------------------------------------------------------------------------------|
|
|
3
|
+
|2026/11/02| |Release 2.28.0 |
|
|
4
|
+
|2026/10/19|241 |Log the assertion and the error when a playbook assertion fails |
|
|
5
|
+
|2026/10/19|241 |Log the assertion and the error when a playbook assertion fails |
|
|
6
|
+
|2026/10/19| |Remove trailing whitespace in `aio_wrapper_path` |
|
|
7
|
+
|2026/10/19| |Honor an explicit threaded false in the client options |
|
|
8
|
+
|2026/10/19|233 |Encode transport payloads as base64 without line breaks |
|
|
9
|
+
|2026/10/16|227 |Serialize a direct request once for all of its nodes |
|
|
10
|
+
|2026/10/16|225 |Validate base64 with String#count instead of a regex |
|
|
11
|
+
|2026/10/16|223 |Support the openssl 4 gem and Ruby 4.0 |
|
|
12
|
+
|2026/10/16| |Bump openvox to 9 |
|
|
13
|
+
|2026/03/04| |Add Ruby 3.4 & 4.0 support |
|
|
14
|
+
|2025/10/03| |Added support for Openvox `execution_wrapper.bat` |
|
|
15
|
+
|2025/07/09| |Drop removed `safe_level` kwarg to erb.new |
|
|
3
16
|
|2024/12/13| |Release 2.27.0 |
|
|
4
17
|
|2026/03/04| |Switch from puppet to openvox gem |
|
|
5
18
|
|2025/07/24|211 |Remove unexpected require from the gemfile |
|
data/Gemfile
CHANGED
|
@@ -11,11 +11,11 @@ group :development, :test do
|
|
|
11
11
|
gem "listen", "~> 3"
|
|
12
12
|
gem "mcollective-test"
|
|
13
13
|
gem "mocha", "~> 0.12.2"
|
|
14
|
-
gem "openvox", "~>
|
|
14
|
+
gem "openvox", "~> 9"
|
|
15
15
|
gem "rake", ">= 12.3.3"
|
|
16
16
|
gem "rdoc"
|
|
17
17
|
gem "rspec", "~> 3.9.0"
|
|
18
|
-
gem "rubocop", "1.
|
|
18
|
+
gem "rubocop", "1.92.1"
|
|
19
19
|
gem "semantic_puppet"
|
|
20
20
|
gem "webmock"
|
|
21
21
|
gem "yard"
|
data/Rakefile
CHANGED
|
@@ -274,17 +274,21 @@ module MCollective
|
|
|
274
274
|
#
|
|
275
275
|
# @param msg [Message]
|
|
276
276
|
def publish_connected_directed(msg)
|
|
277
|
+
# The body and the headers are the same for every node, only the
|
|
278
|
+
# subject differs, so the JSON is built once rather than per node
|
|
279
|
+
headers = headers_for(msg)
|
|
280
|
+
data = {
|
|
281
|
+
"protocol" => "choria:transport:1",
|
|
282
|
+
"data" => msg.payload,
|
|
283
|
+
"headers" => headers
|
|
284
|
+
}.to_json
|
|
285
|
+
|
|
277
286
|
msg.discovered_hosts.each do |node|
|
|
278
|
-
target =
|
|
279
|
-
data = {
|
|
280
|
-
"protocol" => "choria:transport:1",
|
|
281
|
-
"data" => msg.payload,
|
|
282
|
-
"headers" => target[:headers]
|
|
283
|
-
}
|
|
287
|
+
target = make_target(msg.agent, msg.type, msg.collective, node)
|
|
284
288
|
|
|
285
|
-
Log.debug("Sending a direct message to %s via NATS target '%s' for message type %s" % [node, target
|
|
289
|
+
Log.debug("Sending a direct message to %s via NATS target '%s' for message type %s" % [node, target, msg.type])
|
|
286
290
|
|
|
287
|
-
connection.publish(target
|
|
291
|
+
connection.publish(target, data, headers["reply-to"])
|
|
288
292
|
end
|
|
289
293
|
end
|
|
290
294
|
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
# start_with? was introduced in 1.8.7, we need to support
|
|
2
|
-
# 1.8.5 and 1.8.6
|
|
3
|
-
class String
|
|
4
|
-
unless method_defined?("start_with?")
|
|
5
|
-
def start_with?(str)
|
|
6
|
-
self[0..(str.length - 1)] == str
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# Make arrays of Symbols sortable
|
|
12
|
-
class Symbol
|
|
13
|
-
include Comparable
|
|
14
|
-
|
|
15
|
-
unless method_defined?("<=>")
|
|
16
|
-
def <=>(other)
|
|
17
|
-
to_s <=> other.to_s
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# This provides an alias for RbConfig to Config for versions of Ruby older then
|
|
23
|
-
# # version 1.8.5. This allows us to use RbConfig in place of the older Config in
|
|
24
|
-
# # our code and still be compatible with at least Ruby 1.8.1.
|
|
25
|
-
# require 'rbconfig'
|
|
26
|
-
::RbConfig = ::Config unless defined? ::RbConfig
|
|
27
|
-
|
|
28
1
|
# a method # that walks an array in groups, pass a block to
|
|
29
2
|
# call the block on each sub array
|
|
30
3
|
class Array
|
|
@@ -63,97 +36,23 @@ class Array
|
|
|
63
36
|
end
|
|
64
37
|
end
|
|
65
38
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return to_enum(:each_byte) unless block_given?
|
|
71
|
-
|
|
72
|
-
each_byte(&block)
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
class Dir
|
|
78
|
-
unless method_defined?(:mktmpdir)
|
|
79
|
-
def self.mktmpdir(prefix_suffix=nil, tmpdir=nil)
|
|
80
|
-
case prefix_suffix
|
|
81
|
-
when nil
|
|
82
|
-
prefix = "d"
|
|
83
|
-
suffix = ""
|
|
84
|
-
when String
|
|
85
|
-
prefix = prefix_suffix
|
|
86
|
-
suffix = ""
|
|
87
|
-
when Array
|
|
88
|
-
prefix = prefix_suffix[0]
|
|
89
|
-
suffix = prefix_suffix[1]
|
|
90
|
-
else
|
|
91
|
-
raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
|
|
92
|
-
end
|
|
93
|
-
tmpdir ||= Dir.tmpdir
|
|
94
|
-
t = Time.now.strftime("%Y%m%d")
|
|
95
|
-
n = nil
|
|
96
|
-
begin
|
|
97
|
-
path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
|
98
|
-
path << "-#{n}" if n
|
|
99
|
-
path << suffix
|
|
100
|
-
Dir.mkdir(path, 0o700)
|
|
101
|
-
rescue Errno::EEXIST
|
|
102
|
-
n ||= 0
|
|
103
|
-
n += 1
|
|
104
|
-
retry
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
if block_given?
|
|
108
|
-
begin
|
|
109
|
-
yield path
|
|
110
|
-
ensure
|
|
111
|
-
FileUtils.remove_entry_secure path
|
|
112
|
-
end
|
|
113
|
-
else
|
|
114
|
-
path
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
unless method_defined?(:tmpdir)
|
|
120
|
-
def self.tmpdir
|
|
121
|
-
tmp = "."
|
|
122
|
-
[ENV["TMPDIR"], ENV["TMP"], ENV["TEMP"], "/tmp"].each do |dir|
|
|
123
|
-
if dir && (stat = File.stat(dir)) && stat.directory? && stat.writable?
|
|
124
|
-
tmp = dir
|
|
125
|
-
break
|
|
126
|
-
end rescue nil
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
File.expand_path(tmp)
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
# Reject all SSLv2 ciphers and all SSLv2 or SSLv3 handshakes by default
|
|
39
|
+
# Reject all SSLv2 ciphers and all SSLv2 or SSLv3 handshakes by default.
|
|
40
|
+
# The openssl gem freezes DEFAULT_PARAMS from 4.0 on, so the adjusted
|
|
41
|
+
# defaults are passed to set_params on each new context instead of being
|
|
42
|
+
# written into the shared hash.
|
|
135
43
|
require "openssl"
|
|
136
44
|
class OpenSSL::SSL::SSLContext # rubocop:disable Style/ClassAndModuleChildren
|
|
137
|
-
if DEFAULT_PARAMS[:options]
|
|
138
|
-
DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3
|
|
139
|
-
else
|
|
140
|
-
DEFAULT_PARAMS[:options] = OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# ruby 1.8.5 doesn't define this constant, but has it on by default
|
|
144
|
-
DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS if defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS)
|
|
145
|
-
|
|
146
|
-
DEFAULT_PARAMS[:ciphers] << ":!SSLv2" if DEFAULT_PARAMS[:ciphers]
|
|
147
|
-
|
|
148
45
|
alias __mcollective_original_initialize initialize
|
|
149
46
|
private :__mcollective_original_initialize
|
|
150
47
|
|
|
151
48
|
def initialize(*args)
|
|
152
49
|
__mcollective_original_initialize(*args)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
50
|
+
|
|
51
|
+
options = DEFAULT_PARAMS[:options] | OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3 | OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
|
|
52
|
+
|
|
53
|
+
params = {:options => options}
|
|
54
|
+
params[:ciphers] = "#{DEFAULT_PARAMS[:ciphers]}:!SSLv2" if DEFAULT_PARAMS[:ciphers]
|
|
55
|
+
|
|
157
56
|
set_params(params)
|
|
158
57
|
end
|
|
159
58
|
end
|
|
@@ -191,7 +191,7 @@ module MCollective
|
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
def render_template(infile, outfile)
|
|
194
|
-
erb = ERB.new(File.read(infile), :
|
|
194
|
+
erb = ERB.new(File.read(infile), :trim_mode => "-")
|
|
195
195
|
File.open(outfile, "w") do |f|
|
|
196
196
|
f.puts erb.result(binding)
|
|
197
197
|
end
|
|
@@ -80,7 +80,8 @@ module MCollective
|
|
|
80
80
|
@collective = @client.collective
|
|
81
81
|
@ttl = initial_options[:ttl] || Config.instance.ttl
|
|
82
82
|
@publish_timeout = initial_options[:publish_timeout] || Config.instance.publish_timeout
|
|
83
|
-
|
|
83
|
+
# an option given as false wins over the configuration, one absent or nil leaves it to the configuration
|
|
84
|
+
@threaded = initial_options[:threaded].nil? ? Config.instance.threaded : initial_options[:threaded]
|
|
84
85
|
|
|
85
86
|
# if we can find a DDL for the service override
|
|
86
87
|
# the timeout of the client so we always magically
|
data/lib/mcollective/ssl.rb
CHANGED
|
@@ -185,8 +185,11 @@ module MCollective
|
|
|
185
185
|
SSL.base64_encode(string)
|
|
186
186
|
end
|
|
187
187
|
|
|
188
|
+
# Without the line break encode64 adds every 60 characters, which costs
|
|
189
|
+
# two bytes each once escaped inside the transport JSON and nothing to
|
|
190
|
+
# leave out, since the decoders accept unbroken base64
|
|
188
191
|
def self.base64_encode(string)
|
|
189
|
-
Base64.
|
|
192
|
+
Base64.strict_encode64(string)
|
|
190
193
|
end
|
|
191
194
|
|
|
192
195
|
# base 64 decode a string
|
|
@@ -196,8 +199,11 @@ module MCollective
|
|
|
196
199
|
|
|
197
200
|
def self.base64_decode(string)
|
|
198
201
|
# The Base 64 character set is A-Z a-z 0-9 + / =
|
|
199
|
-
# Also allow for whitespace, but raise if we get anything else
|
|
200
|
-
|
|
202
|
+
# Also allow for whitespace, but raise if we get anything else.
|
|
203
|
+
# String#count checks a megabyte in well under a millisecond where
|
|
204
|
+
# a regex over the whole string took tens of milliseconds and a
|
|
205
|
+
# backtrack stack of its own size.
|
|
206
|
+
raise(ArgumentError, "invalid base64") if string.empty? || string.count("^A-Za-z0-9+/= \t\r\n\f\v") > 0
|
|
201
207
|
|
|
202
208
|
Base64.decode64(string)
|
|
203
209
|
end
|
|
@@ -259,22 +265,6 @@ module MCollective
|
|
|
259
265
|
key = OpenSSL::X509::Certificate.new(File.read(key)).public_key
|
|
260
266
|
end
|
|
261
267
|
|
|
262
|
-
# Ruby < 1.9.3 had a bug where it does not correctly clear the
|
|
263
|
-
# queue of errors while reading a key. It tries various ways
|
|
264
|
-
# to read the key and each failing attempt pushes an error onto
|
|
265
|
-
# the queue. With pubkeys only the 3rd attempt pass leaving 2
|
|
266
|
-
# stale errors on the error queue.
|
|
267
|
-
#
|
|
268
|
-
# In 1.9.3 they fixed this by simply discarding the errors after
|
|
269
|
-
# every attempt. So we simulate this fix here for older rubies
|
|
270
|
-
# as without it we get SSL_read errors from the Stomp+TLS sessions
|
|
271
|
-
#
|
|
272
|
-
# We do this only on 1.8 relying on 1.9.3 to do the right thing
|
|
273
|
-
# and we do not support 1.9 less than 1.9.3
|
|
274
|
-
#
|
|
275
|
-
# See http://bugs.ruby-lang.org/issues/4550
|
|
276
|
-
OpenSSL.errors if Util.ruby_version =~ /^1.8/
|
|
277
|
-
|
|
278
268
|
key
|
|
279
269
|
when :private
|
|
280
270
|
OpenSSL::PKey::RSA.new(File.read(key), passphrase)
|
|
@@ -755,13 +755,7 @@ module MCollective
|
|
|
755
755
|
|
|
756
756
|
extra_chain_cert = cert_chain[1..-1]
|
|
757
757
|
|
|
758
|
-
|
|
759
|
-
context.add_certificate(cert, key, extra_chain_cert)
|
|
760
|
-
else
|
|
761
|
-
context.cert = OpenSSL::X509::Certificate.new(File.read(client_public_cert))
|
|
762
|
-
context.key = OpenSSL::PKey::RSA.new(File.read(client_private_key))
|
|
763
|
-
context.extra_chain_cert = extra_chain_cert
|
|
764
|
-
end
|
|
758
|
+
context.add_certificate(cert, key, extra_chain_cert)
|
|
765
759
|
|
|
766
760
|
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
767
761
|
|
|
@@ -287,8 +287,9 @@ module MCollective
|
|
|
287
287
|
begin
|
|
288
288
|
Log.debug("Asserting '%s' over %d replies" % [@assertion, replies.size])
|
|
289
289
|
result = JGrep.jgrep(jdata, @assertion)
|
|
290
|
-
rescue
|
|
291
|
-
Log.error("Assertion '%s' could not be matched: %s" % [@
|
|
290
|
+
rescue => e
|
|
291
|
+
Log.error("Assertion '%s' could not be matched: %s: %s" % [@assertion, e.class, e.to_s])
|
|
292
|
+
Log.debug(e.backtrace.join("\t\n"))
|
|
292
293
|
end
|
|
293
294
|
|
|
294
295
|
[result.size == expected, expected - result.size]
|
|
@@ -79,7 +79,10 @@ module MCollective
|
|
|
79
79
|
legacy = File.join(aio_bin_path, "task_wrapper.exe")
|
|
80
80
|
return legacy if File.exist?(legacy)
|
|
81
81
|
|
|
82
|
-
File.join(aio_bin_path, "execution_wrapper.exe")
|
|
82
|
+
legacy_puppet = File.join(aio_bin_path, "execution_wrapper.exe")
|
|
83
|
+
return legacy_puppet if File.exist?(legacy_puppet)
|
|
84
|
+
|
|
85
|
+
File.join(aio_bin_path, "execution_wrapper.bat")
|
|
83
86
|
else
|
|
84
87
|
legacy = File.join(aio_bin_path, "task_wrapper")
|
|
85
88
|
return legacy if File.exist?(legacy)
|
data/lib/mcollective/util.rb
CHANGED
|
@@ -331,12 +331,6 @@ module MCollective
|
|
|
331
331
|
"%s%s%s" % [color(code), msg, color(:reset)]
|
|
332
332
|
end
|
|
333
333
|
|
|
334
|
-
# Returns the current ruby version as per RUBY_VERSION, mostly
|
|
335
|
-
# doing this here to aid testing
|
|
336
|
-
def self.ruby_version
|
|
337
|
-
RUBY_VERSION
|
|
338
|
-
end
|
|
339
|
-
|
|
340
334
|
def self.mcollective_version
|
|
341
335
|
MCollective::VERSION
|
|
342
336
|
end
|
|
@@ -545,50 +539,11 @@ module MCollective
|
|
|
545
539
|
number == 0 ? 1 : number
|
|
546
540
|
end
|
|
547
541
|
|
|
548
|
-
def self.get_hidden_input_on_windows # rubocop:disable Naming/AccessorMethodName
|
|
549
|
-
require "Win32API"
|
|
550
|
-
|
|
551
|
-
# Hook into getch from crtdll. Keep reading all keys till return
|
|
552
|
-
# or newline is hit.
|
|
553
|
-
# If key is backspace or delete, then delete the character and update
|
|
554
|
-
# the buffer.
|
|
555
|
-
input = ""
|
|
556
|
-
|
|
557
|
-
while char = Win32API.new("crtdll", "_getch", [], "I").Call
|
|
558
|
-
break if [10, 13].include?(char) # return or newline
|
|
559
|
-
|
|
560
|
-
if [127, 8].include?(char) # backspace and delete
|
|
561
|
-
input.slice!(-1, 1) unless input.empty?
|
|
562
|
-
else
|
|
563
|
-
input << char.chr
|
|
564
|
-
end
|
|
565
|
-
end
|
|
566
|
-
|
|
567
|
-
input
|
|
568
|
-
end
|
|
569
|
-
|
|
570
|
-
def self.get_hidden_input_on_unix # rubocop:disable Naming/AccessorMethodName
|
|
571
|
-
raise "Could not hook to stdin to hide input. If using SSH, try using -t flag while connecting to server." unless $stdin.tty?
|
|
572
|
-
raise "Could not hide input using stty command." unless system "stty -echo -icanon"
|
|
573
|
-
|
|
574
|
-
input = $stdin.gets
|
|
575
|
-
ensure
|
|
576
|
-
raise "Could not enable echoing of input. Try executing `stty echo icanon` to debug." unless system "stty echo icanon"
|
|
577
|
-
|
|
578
|
-
input
|
|
579
|
-
end
|
|
580
|
-
|
|
581
542
|
def self.get_hidden_input(message="Please enter data: ")
|
|
582
543
|
print message unless message.nil?
|
|
583
544
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
input = $stdin.noecho(&:gets)
|
|
587
|
-
elsif windows? # Use hacks to get hidden input on Ruby <1.9.3
|
|
588
|
-
input = get_hidden_input_on_windows
|
|
589
|
-
else
|
|
590
|
-
input = get_hidden_input_on_unix
|
|
591
|
-
end
|
|
545
|
+
require "io/console"
|
|
546
|
+
input = $stdin.noecho(&:gets)
|
|
592
547
|
|
|
593
548
|
input.chomp! if input
|
|
594
549
|
|
data/lib/mcollective.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: choria-mcorpc-support
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.28.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- R.I.Pienaar
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: systemu
|
|
@@ -50,6 +50,34 @@ dependencies:
|
|
|
50
50
|
- - "<"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
52
|
version: 0.7.0
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: base64
|
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
type: :runtime
|
|
61
|
+
prerelease: false
|
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0'
|
|
67
|
+
- !ruby/object:Gem::Dependency
|
|
68
|
+
name: logger
|
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - ">="
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '0'
|
|
74
|
+
type: :runtime
|
|
75
|
+
prerelease: false
|
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - ">="
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '0'
|
|
53
81
|
description: Libraries enabling Ruby support for the Choria Orchestration Server
|
|
54
82
|
email: rip@devco.net
|
|
55
83
|
executables:
|
|
@@ -59,7 +87,6 @@ extra_rdoc_files: []
|
|
|
59
87
|
files:
|
|
60
88
|
- ".rspec"
|
|
61
89
|
- ".rubocop.yml"
|
|
62
|
-
- ".ruby-version"
|
|
63
90
|
- CHANGELOG.md
|
|
64
91
|
- CODE_OF_CONDUCT.md
|
|
65
92
|
- CONTRIBUTING.md
|
|
@@ -255,7 +282,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
255
282
|
requirements:
|
|
256
283
|
- - ">="
|
|
257
284
|
- !ruby/object:Gem::Version
|
|
258
|
-
version: '
|
|
285
|
+
version: '3.4'
|
|
259
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
287
|
requirements:
|
|
261
288
|
- - ">="
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.2.3
|