bolt 3.6.0 → 3.6.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa3e5ea7d868b032557568e9635fcf159f00b81e4961dce4032246cc150a7c16
4
- data.tar.gz: 0e9fada8a0518ab174412e21ec843091272cb0afe87980703ebd6d8ed91002dd
3
+ metadata.gz: 87e8cf7f5ccf5d0649f608b088e4162495b6f5c1c2887711ab6f4355b6a3934f
4
+ data.tar.gz: 0bbac1eed6b37508b1e1f1b90f67a7b687f089415e4daf333e63e71d784c3538
5
5
  SHA512:
6
- metadata.gz: 66d8df12e0142b6d5872a40f7c0d97b0438c833e4681be6646e17b85496c3a9e1148ff0a2ff34572e0ce788861d928c406dddcb97feb5281ac0d7eb2d7d14ead
7
- data.tar.gz: f6dafaa37a4af7633610e26cc084d69c865f0b8df18221d407f2ee077e58e0a582e88cccf49d3a590e7984d56d8ac467ee8704e6ac0e60cc7e37b1a846396d26
6
+ metadata.gz: b534fbfc3a4b15ad9b130a24fb3a1274f05592d9dedb185031fe409364e9e0c10b1af5c90571f0e9a9fd0b5d70817d2e5edf17bf25c9750ac801c0e83c872766
7
+ data.tar.gz: 3032fed7c7493eeb06d97814eee9496c634522905b36ec67e794da36581815a5786d35afb2f413484c3b5b2b578e8107e7b0c224dfb3003095dc47d0d8a643ec
@@ -396,7 +396,12 @@ module Bolt
396
396
  # See if there's a sudo prompt
397
397
  if use_sudo
398
398
  ready_read = select([err], nil, nil, timeout * 5)
399
- read_streams[err] << check_sudo(err, inp, options[:stdin]) if ready_read
399
+ to_print = check_sudo(err, inp, options[:stdin]) if ready_read
400
+ unless to_print.nil?
401
+ log_stream(to_print, 'err')
402
+ read_streams[err] << to_print
403
+ result_output.merged_output << to_print
404
+ end
400
405
  end
401
406
 
402
407
  # True while the process is running or waiting for IO input
@@ -412,14 +417,7 @@ module Bolt
412
417
  else
413
418
  stream.readpartial(CHUNK_SIZE)
414
419
  end
415
-
416
- if !to_print.chomp.empty? && @stream_logger
417
- formatted = to_print.lines.map do |msg|
418
- "[#{@target.safe_name}] #{stream_name}: #{msg.chomp}"
419
- end.join("\n")
420
- @stream_logger.warn(formatted)
421
- end
422
-
420
+ log_stream(to_print, stream_name)
423
421
  read_streams[stream] << to_print
424
422
  result_output.merged_output << to_print
425
423
  rescue EOFError
@@ -458,7 +456,13 @@ module Bolt
458
456
  # Read any remaining data in the pipe. Do not wait for
459
457
  # EOF in case the pipe is inherited by a child process.
460
458
  read_streams.each do |stream, _|
461
- loop { read_streams[stream] << stream.read_nonblock(CHUNK_SIZE) }
459
+ stream_name = stream == out ? 'out' : 'err'
460
+ loop {
461
+ to_print = stream.read_nonblock(CHUNK_SIZE)
462
+ log_stream(to_print, stream_name)
463
+ read_streams[stream] << to_print
464
+ result_output.merged_output << to_print
465
+ }
462
466
  rescue Errno::EAGAIN, EOFError
463
467
  end
464
468
  result_output.stdout << read_streams[out]
@@ -489,6 +493,15 @@ module Bolt
489
493
  def sudo_prompt
490
494
  '[sudo] Bolt needs to run as another user, password: '
491
495
  end
496
+
497
+ private def log_stream(to_print, stream_name)
498
+ if !to_print.chomp.empty? && @stream_logger
499
+ formatted = to_print.lines.map do |msg|
500
+ "[#{@target.safe_name}] #{stream_name}: #{msg.chomp}"
501
+ end.join("\n")
502
+ @stream_logger.warn(formatted)
503
+ end
504
+ end
492
505
  end
493
506
  end
494
507
  end
data/lib/bolt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bolt
4
- VERSION = '3.6.0'
4
+ VERSION = '3.6.1'
5
5
  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: 3.6.0
4
+ version: 3.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-06 00:00:00.000000000 Z
11
+ date: 2021-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable