bolt 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bolt might be problematic. Click here for more details.

Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bolt/cli.rb +32 -17
  3. data/lib/bolt/config.rb +12 -31
  4. data/lib/bolt/error.rb +18 -7
  5. data/lib/bolt/executor.rb +3 -3
  6. data/lib/bolt/inventory.rb +101 -0
  7. data/lib/bolt/inventory/group.rb +127 -0
  8. data/lib/bolt/node.rb +10 -9
  9. data/lib/bolt/node/ssh.rb +86 -69
  10. data/lib/bolt/node/winrm.rb +3 -3
  11. data/lib/bolt/outputter/human.rb +1 -1
  12. data/lib/bolt/pal.rb +17 -11
  13. data/lib/bolt/result.rb +9 -4
  14. data/lib/bolt/target.rb +26 -11
  15. data/lib/bolt/util.rb +54 -0
  16. data/lib/bolt/version.rb +1 -1
  17. data/modules/boltlib/lib/puppet/functions/fail_plan.rb +27 -0
  18. data/modules/boltlib/lib/puppet/functions/file_upload.rb +4 -4
  19. data/modules/boltlib/lib/puppet/functions/run_command.rb +3 -3
  20. data/modules/boltlib/lib/puppet/functions/run_plan.rb +18 -4
  21. data/modules/boltlib/lib/puppet/functions/run_script.rb +5 -2
  22. data/modules/boltlib/lib/puppet/functions/run_task.rb +3 -3
  23. data/vendored/puppet/lib/puppet/datatypes/error.rb +5 -3
  24. data/vendored/puppet/lib/puppet/datatypes/impl/error.rb +10 -12
  25. data/vendored/puppet/lib/puppet/defaults.rb +33 -25
  26. data/vendored/puppet/lib/puppet/etc.rb +2 -2
  27. data/vendored/puppet/lib/puppet/external/pson/pure/generator.rb +1 -1
  28. data/vendored/puppet/lib/puppet/external/pson/pure/parser.rb +1 -1
  29. data/vendored/puppet/lib/puppet/face/config.rb +45 -0
  30. data/vendored/puppet/lib/puppet/face/module/generate.rb +5 -0
  31. data/vendored/puppet/lib/puppet/functions/annotate.rb +1 -1
  32. data/vendored/puppet/lib/puppet/functions/any.rb +1 -1
  33. data/vendored/puppet/lib/puppet/generate/type.rb +1 -1
  34. data/vendored/puppet/lib/puppet/gettext/config.rb +2 -2
  35. data/vendored/puppet/lib/puppet/gettext/stubs.rb +1 -1
  36. data/vendored/puppet/lib/puppet/interface/action.rb +11 -0
  37. data/vendored/puppet/lib/puppet/interface/action_builder.rb +8 -0
  38. data/vendored/puppet/lib/puppet/network/authstore.rb +1 -1
  39. data/vendored/puppet/lib/puppet/network/http/connection.rb +1 -1
  40. data/vendored/puppet/lib/puppet/parameter/boolean.rb +1 -1
  41. data/vendored/puppet/lib/puppet/parser/ast/branch.rb +1 -1
  42. data/vendored/puppet/lib/puppet/parser/functions/new.rb +1 -1
  43. data/vendored/puppet/lib/puppet/parser/functions/reverse_each.rb +1 -1
  44. data/vendored/puppet/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
  45. data/vendored/puppet/lib/puppet/pops/evaluator/evaluator_impl.rb +3 -3
  46. data/vendored/puppet/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
  47. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
  48. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +1 -1
  49. data/vendored/puppet/lib/puppet/pops/issues.rb +1 -1
  50. data/vendored/puppet/lib/puppet/pops/loader/loader.rb +1 -1
  51. data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +1 -1
  52. data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +3 -5
  53. data/vendored/puppet/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +1 -1
  54. data/vendored/puppet/lib/puppet/pops/loader/runtime3_type_loader.rb +1 -1
  55. data/vendored/puppet/lib/puppet/pops/loaders.rb +40 -1
  56. data/vendored/puppet/lib/puppet/pops/lookup/interpolation.rb +1 -1
  57. data/vendored/puppet/lib/puppet/pops/model/tree_dumper.rb +1 -1
  58. data/vendored/puppet/lib/puppet/pops/parser/epp_support.rb +1 -1
  59. data/vendored/puppet/lib/puppet/pops/parser/interpolation_support.rb +1 -1
  60. data/vendored/puppet/lib/puppet/pops/parser/lexer2.rb +1 -1
  61. data/vendored/puppet/lib/puppet/pops/parser/lexer_support.rb +2 -2
  62. data/vendored/puppet/lib/puppet/pops/parser/locatable.rb +1 -1
  63. data/vendored/puppet/lib/puppet/pops/parser/locator.rb +2 -6
  64. data/vendored/puppet/lib/puppet/pops/resource/param.rb +1 -1
  65. data/vendored/puppet/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  66. data/vendored/puppet/lib/puppet/pops/types/iterable.rb +1 -1
  67. data/vendored/puppet/lib/puppet/pops/types/tree_iterators.rb +5 -1
  68. data/vendored/puppet/lib/puppet/pops/types/type_acceptor.rb +1 -1
  69. data/vendored/puppet/lib/puppet/pops/types/type_calculator.rb +1 -1
  70. data/vendored/puppet/lib/puppet/pops/types/type_with_members.rb +1 -1
  71. data/vendored/puppet/lib/puppet/pops/types/types.rb +1 -1
  72. data/vendored/puppet/lib/puppet/provider/package/yum.rb +1 -1
  73. data/vendored/puppet/lib/puppet/provider/service/redhat.rb +3 -2
  74. data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
  75. data/vendored/puppet/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
  76. data/vendored/puppet/lib/puppet/resource/type.rb +1 -1
  77. data/vendored/puppet/lib/puppet/settings/base_setting.rb +1 -1
  78. data/vendored/puppet/lib/puppet/settings/ini_file.rb +33 -12
  79. data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +2 -2
  80. data/vendored/puppet/lib/puppet/transaction.rb +37 -14
  81. data/vendored/puppet/lib/puppet/type/cron.rb +1 -1
  82. data/vendored/puppet/lib/puppet/type/file/checksum.rb +6 -0
  83. data/vendored/puppet/lib/puppet/type/mount.rb +0 -9
  84. data/vendored/puppet/lib/puppet/util/character_encoding.rb +2 -2
  85. data/vendored/puppet/lib/puppet/util/network_device/cisco/device.rb +5 -5
  86. data/vendored/puppet/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
  87. data/vendored/puppet/lib/puppet/util/windows/process.rb +1 -1
  88. data/vendored/puppet/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
  89. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
  90. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
  91. metadata +20 -2
@@ -99,7 +99,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
99
99
  :VirtualAccess => %w{Virtual-Access Virtual-A Virtual Virt}
100
100
  }
101
101
 
102
- def canonalize_ifname(interface)
102
+ def canonicalize_ifname(interface)
103
103
  IF.each do |k,ifnames|
104
104
  if found = ifnames.find { |ifname| interface =~ /^#{ifname}\s*\d/i }
105
105
  found = /^#{found}(.+)\Z/i.match(interface)
@@ -119,7 +119,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
119
119
  end
120
120
 
121
121
  def interface(name)
122
- ifname = canonalize_ifname(name)
122
+ ifname = canonicalize_ifname(name)
123
123
  interface = parse_interface(ifname)
124
124
  return { :ensure => :absent } if interface.empty?
125
125
  interface.merge!(parse_trunking(ifname))
@@ -127,7 +127,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
127
127
  end
128
128
 
129
129
  def new_interface(name)
130
- Puppet::Util::NetworkDevice::Cisco::Interface.new(canonalize_ifname(name), transport)
130
+ Puppet::Util::NetworkDevice::Cisco::Interface.new(canonicalize_ifname(name), transport)
131
131
  end
132
132
 
133
133
  def parse_interface(name)
@@ -192,13 +192,13 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
192
192
  when /^(\d+)\s+(\w+)\s+(\w+)\s+([a-zA-Z0-9,\/. ]+)\s*$/
193
193
  vlan = { :name => $1, :description => $2, :status => $3, :interfaces => [] }
194
194
  if $4.strip.length > 0
195
- vlan[:interfaces] = $4.strip.split(/\s*,\s*/).map{ |ifn| canonalize_ifname(ifn) }
195
+ vlan[:interfaces] = $4.strip.split(/\s*,\s*/).map{ |ifn| canonicalize_ifname(ifn) }
196
196
  end
197
197
  vlans[vlan[:name]] = vlan
198
198
  when /^\s+([a-zA-Z0-9,\/. ]+)\s*$/
199
199
  raise _("invalid sh vlan summary output") unless vlan
200
200
  if $1.strip.length > 0
201
- vlan[:interfaces] += $1.strip.split(/\s*,\s*/).map{ |ifn| canonalize_ifname(ifn) }
201
+ vlan[:interfaces] += $1.strip.split(/\s*,\s*/).map{ |ifn| canonicalize_ifname(ifn) }
202
202
  end
203
203
  else
204
204
  end
@@ -160,7 +160,7 @@ module Generators
160
160
  @allfiles << { "file" => file, "modules" => modules, "classes" => classes, "methods" => methods, "nodes" => nodes }
161
161
  end
162
162
 
163
- # scan all classes to create the childs references
163
+ # scan all classes to create the child's references
164
164
  @allclasses.values.each do |klass|
165
165
  if superklass = klass.context.superclass
166
166
  if superklass = AllReferences[superklass] and (superklass.is_a?(HTMLPuppetClass) or superklass.is_a?(HTMLPuppetNode))
@@ -232,7 +232,7 @@ module Puppet::Util::Windows::Process
232
232
  # Note - Some env variable names start with '=' and are excluded from the return value
233
233
  # Note - The env_ptr MUST be freed using the FreeEnvironmentStringsW function
234
234
  # Note - There is no technical limitation to the size of the environment block returned.
235
- # However a pracitcal limit of 64K is used as no single environment variable can exceed 32KB
235
+ # However a practical limit of 64K is used as no single environment variable can exceed 32KB
236
236
  def get_environment_strings
237
237
  env_ptr = GetEnvironmentStringsW()
238
238
 
@@ -60,7 +60,7 @@ class GitIgnoreSpec < RegexSpec
60
60
  pattern_segs.shift
61
61
  else
62
62
  # A pattern without a beginning slash ('/') will match any
63
- # descendant path. This is equivilent to "**/{pattern}". So,
63
+ # descendant path. This is equivalent to "**/{pattern}". So,
64
64
  # prepend with double-asterisks to make pattern relative to
65
65
  # root.
66
66
  if pattern_segs.length == 1 && pattern_segs[0] != '**'
@@ -70,7 +70,7 @@ class GitIgnoreSpec < RegexSpec
70
70
 
71
71
  # A pattern ending with a slash ('/') will match all descendant
72
72
  # paths of if it is a directory but not if it is a regular file.
73
- # This is equivilent to "{pattern}/**". So, set last segment to
73
+ # This is equivalent to "{pattern}/**". So, set last segment to
74
74
  # double asterisks to include all descendants.
75
75
  if pattern_segs[-1].empty?
76
76
  pattern_segs[-1] = '**'
@@ -185,13 +185,13 @@ class GitIgnoreSpec < RegexSpec
185
185
  elsif char == '?'
186
186
  regex += '[^/]'
187
187
 
188
- # Braket expression wildcard. Except for the beginning
189
- # exclamation mark, the whole braket expression can be used
188
+ # Bracket expression wildcard. Except for the beginning
189
+ # exclamation mark, the whole bracket expression can be used
190
190
  # directly as regex but we have to find where the expression
191
191
  # ends.
192
- # - "[][!]" matchs ']', '[' and '!'.
193
- # - "[]-]" matchs ']' and '-'.
194
- # - "[!]a-]" matchs any character except ']', 'a' and '-'.
192
+ # - "[][!]" matches ']', '[' and '!'.
193
+ # - "[]-]" matches ']' and '-'.
194
+ # - "[!]a-]" matches any character except ']', 'a' and '-'.
195
195
  elsif char == '['
196
196
  j = i
197
197
  # Pass brack expression negation.
@@ -199,13 +199,13 @@ class GitIgnoreSpec < RegexSpec
199
199
  j += 1
200
200
  end
201
201
 
202
- # Pass first closing braket if it is at the beginning of the
202
+ # Pass first closing bracket if it is at the beginning of the
203
203
  # expression.
204
204
  if j < pattern.size && pattern[j].chr == ']'
205
205
  j += 1
206
206
  end
207
207
 
208
- # Find closing braket. Stop once we reach the end or find it.
208
+ # Find closing bracket. Stop once we reach the end or find it.
209
209
  while j < pattern.size && pattern[j].chr != ']'
210
210
  j += 1
211
211
  end
@@ -214,12 +214,12 @@ class GitIgnoreSpec < RegexSpec
214
214
  if j < pattern.size
215
215
  expr = '['
216
216
 
217
- # Braket expression needs to be negated.
217
+ # Bracket expression needs to be negated.
218
218
  if pattern[i].chr == '!'
219
219
  expr += '^'
220
220
  i += 1
221
221
 
222
- # POSIX declares that the regex braket expression negation
222
+ # POSIX declares that the regex bracket expression negation
223
223
  # "[^...]" is undefined in a glob pattern. Python's
224
224
  # `fnmatch.translate()` escapes the caret ('^') as a
225
225
  # literal. To maintain consistency with undefined behavior,
@@ -236,26 +236,26 @@ class GitIgnoreSpec < RegexSpec
236
236
  end
237
237
 
238
238
 
239
- # Build regex braket expression. Escape slashes so they are
239
+ # Build regex bracket expression. Escape slashes so they are
240
240
  # treated as literal slashes by regex as defined by POSIX.
241
241
  expr += pattern[i..j].sub('\\', '\\\\')
242
242
 
243
- # Add regex braket expression to regex result.
243
+ # Add regex bracket expression to regex result.
244
244
  regex += expr
245
245
 
246
- # Found end of braket expression. Increment j to be one past
247
- # the closing braket:
246
+ # Found end of bracket expression. Increment j to be one past
247
+ # the closing bracket:
248
248
  #
249
249
  # [...]
250
250
  # ^ ^
251
251
  # i j
252
252
  #
253
253
  j += 1
254
- # Set i to one past the closing braket.
254
+ # Set i to one past the closing bracket.
255
255
  i = j
256
256
 
257
- # Failed to find closing braket, treat opening braket as a
258
- # braket literal instead of as an expression.
257
+ # Failed to find closing bracket, treat opening bracket as a
258
+ # bracket literal instead of as an expression.
259
259
  else
260
260
  regex += '\['
261
261
  end
@@ -161,7 +161,7 @@ module SemanticPuppet
161
161
  else
162
162
  # Compare all prerelease identifier segments that can be compared. Should
163
163
  # all segments compare equal up to the point where one of the prereleases
164
- # have no more segments, then the one with more segements is greater.
164
+ # have no more segments, then the one with more segments is greater.
165
165
  your_max = yours.size
166
166
  mine.each_with_index do |x, idx|
167
167
  # 'mine' win if 'your' list of segments is exhausted
@@ -181,7 +181,7 @@ module SemanticPuppet
181
181
  return cmp unless cmp == 0
182
182
  end
183
183
 
184
- # All segments, up to the point where at least one list of segement is exhausted,
184
+ # All segments, up to the point where at least one list of segment is exhausted,
185
185
  # compared equal. The one with the highest segment count wins.
186
186
  mine.size <=> your_max
187
187
  end
@@ -407,8 +407,8 @@ module SemanticPuppet
407
407
 
408
408
  # Merge two ranges so that the result matches the intersection of all matching versions.
409
409
  #
410
- # @param range [AbastractRange] the range to intersect with
411
- # @return [AbastractRange,nil] the intersection between the ranges
410
+ # @param range [AbstractRange] the range to intersect with
411
+ # @return [AbstractRange,nil] the intersection between the ranges
412
412
  #
413
413
  # @api private
414
414
  def intersection(range)
@@ -456,8 +456,8 @@ module SemanticPuppet
456
456
  # Merge two ranges so that the result matches the sum of all matching versions. A merge
457
457
  # is only possible when the ranges are either adjacent or have an overlap.
458
458
  #
459
- # @param other [AbastractRange] the range to merge with
460
- # @return [AbastractRange,nil] the result of the merge
459
+ # @param other [AbstractRange] the range to merge with
460
+ # @return [AbstractRange,nil] the result of the merge
461
461
  #
462
462
  # @api private
463
463
  def merge(other)
@@ -508,7 +508,7 @@ module SemanticPuppet
508
508
  # Checks if this matcher accepts a prerelease with the same major, minor, patch triple as the given version. Only matchers
509
509
  # where this has been explicitly stated will respond `true` to this method
510
510
  #
511
- # @return [Boolean] `true` if this matcher accepts a prerelase with the tuple from the given version
511
+ # @return [Boolean] `true` if this matcher accepts a prerelease with the tuple from the given version
512
512
  def test_prerelease?(_)
513
513
  false
514
514
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -254,6 +254,20 @@ dependencies:
254
254
  - - '='
255
255
  - !ruby/object:Gem::Version
256
256
  version: 0.8.8
257
+ - !ruby/object:Gem::Dependency
258
+ name: ffi
259
+ requirement: !ruby/object:Gem::Requirement
260
+ requirements:
261
+ - - "<="
262
+ - !ruby/object:Gem::Version
263
+ version: 1.9.18
264
+ type: :runtime
265
+ prerelease: false
266
+ version_requirements: !ruby/object:Gem::Requirement
267
+ requirements:
268
+ - - "<="
269
+ - !ruby/object:Gem::Version
270
+ version: 1.9.18
257
271
  - !ruby/object:Gem::Dependency
258
272
  name: puppetlabs_spec_helper
259
273
  requirement: !ruby/object:Gem::Requirement
@@ -324,6 +338,8 @@ files:
324
338
  - lib/bolt/config.rb
325
339
  - lib/bolt/error.rb
326
340
  - lib/bolt/executor.rb
341
+ - lib/bolt/inventory.rb
342
+ - lib/bolt/inventory/group.rb
327
343
  - lib/bolt/logger.rb
328
344
  - lib/bolt/node.rb
329
345
  - lib/bolt/node/errors.rb
@@ -339,10 +355,12 @@ files:
339
355
  - lib/bolt/result.rb
340
356
  - lib/bolt/result_set.rb
341
357
  - lib/bolt/target.rb
358
+ - lib/bolt/util.rb
342
359
  - lib/bolt/version.rb
343
360
  - modules/boltlib/lib/puppet/datatypes/result.rb
344
361
  - modules/boltlib/lib/puppet/datatypes/resultset.rb
345
362
  - modules/boltlib/lib/puppet/datatypes/target.rb
363
+ - modules/boltlib/lib/puppet/functions/fail_plan.rb
346
364
  - modules/boltlib/lib/puppet/functions/file_upload.rb
347
365
  - modules/boltlib/lib/puppet/functions/run_command.rb
348
366
  - modules/boltlib/lib/puppet/functions/run_plan.rb