bolt 3.7.0 → 3.7.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.

data/lib/bolt/cli.rb CHANGED
@@ -892,7 +892,7 @@ module Bolt
892
892
 
893
893
  # Display the list of available Bolt guides.
894
894
  def list_topics
895
- outputter.print_topics(guides.keys)
895
+ outputter.print_topics(guides.keys - ['guide'])
896
896
  0
897
897
  end
898
898
 
@@ -67,8 +67,7 @@ module Bolt
67
67
  elsif git.start_with?('https://github.com')
68
68
  git.split('https://github.com/').last.split('.git').first
69
69
  else
70
- raise Bolt::ValidationError,
71
- "Invalid git source: #{git}. Only GitHub modules are supported."
70
+ raise Bolt::ValidationError, invalid_git_msg(git)
72
71
  end
73
72
 
74
73
  [git, repo]
@@ -89,6 +88,14 @@ module Bolt
89
88
  }
90
89
  end
91
90
 
91
+ # Returns an error message that the provided repo is not a git repo or
92
+ # is private.
93
+ #
94
+ private def invalid_git_msg(repo_name)
95
+ "#{repo_name} is not a public GitHub repository. See https://pup.pt/no-resolve "\
96
+ "for information on how to install this module."
97
+ end
98
+
92
99
  # Returns a PuppetfileResolver::Model::GitModule object for resolving.
93
100
  #
94
101
  def to_resolver_module
@@ -157,10 +164,7 @@ module Bolt
157
164
 
158
165
  raise Bolt::Error.new(message, 'bolt/github-api-rate-limit-error')
159
166
  when Net::HTTPNotFound
160
- raise Bolt::Error.new(
161
- "#{git} is not a git repository.",
162
- "bolt/missing-git-repository-error"
163
- )
167
+ raise Bolt::Error.new(invalid_git_msg(git), "bolt/missing-git-repository-error")
164
168
  else
165
169
  raise Bolt::Error.new(
166
170
  "Ref #{ref} at #{git} is not a commit, tag, or branch.",
@@ -293,7 +293,7 @@ module Bolt
293
293
  end
294
294
 
295
295
  def print_tasks(tasks, modulepath)
296
- command = Bolt::Util.powershell? ? 'Get-BoltTask -Task <TASK NAME>' : 'bolt task show <TASK NAME>'
296
+ command = Bolt::Util.powershell? ? 'Get-BoltTask -Name <TASK NAME>' : 'bolt task show <TASK NAME>'
297
297
 
298
298
  tasks = tasks.map do |name, description|
299
299
  description = truncate(description, 72)
@@ -46,8 +46,8 @@ module Bolt
46
46
  def connect
47
47
  # We don't actually have a connection, but we do need to
48
48
  # check that the container exists and is running.
49
- output = execute_local_json_command('ps')
50
- index = output.find_index { |item| item["ID"] == target.host || item["Names"] == target.host }
49
+ output = execute_local_json_command('ps', ['--no-trunc'])
50
+ index = output.find_index { |item| item["ID"].start_with?(target.host) || item["Names"] == target.host }
51
51
  raise "Could not find a container with name or ID matching '#{target.host}'" if index.nil?
52
52
  # Now find the indepth container information
53
53
  output = execute_local_json_command('inspect', [output[index]["ID"]])
@@ -39,8 +39,6 @@ module Bolt
39
39
  end
40
40
  end
41
41
 
42
- PAGEANT_NAME = "Pageant\0".encode(Encoding::UTF_16LE)
43
-
44
42
  def connect
45
43
  options = {
46
44
  logger: @transport_logger,
@@ -115,10 +113,9 @@ module Bolt
115
113
  options[:use_agent] = false
116
114
  end
117
115
  elsif Bolt::Util.windows?
118
- require 'Win32API' # case matters in this require!
119
- # https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-findwindoww
120
- @find_window ||= Win32API.new('user32', 'FindWindowW', %w[P P], 'L')
121
- if @find_window.call(nil, PAGEANT_NAME).to_i == 0
116
+ pageant = Net::SSH::Authentication::Pageant::Win.FindWindow("Pageant", "Pageant")
117
+ # If pageant is not running
118
+ if pageant.to_i == 0
122
119
  @logger.debug { "Disabling use_agent in net-ssh: pageant process not running" }
123
120
  options[:use_agent] = false
124
121
  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.7.0'
4
+ VERSION = '3.7.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.7.0
4
+ version: 3.7.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-13 00:00:00.000000000 Z
11
+ date: 2021-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -450,12 +450,15 @@ files:
450
450
  - bolt-modules/prompt/lib/puppet/functions/prompt/menu.rb
451
451
  - bolt-modules/system/lib/puppet/functions/system/env.rb
452
452
  - exe/bolt
453
+ - guides/guide.txt
453
454
  - guides/inventory.txt
455
+ - guides/links.txt
454
456
  - guides/logging.txt
455
457
  - guides/module.txt
456
458
  - guides/modulepath.txt
457
459
  - guides/project.txt
458
460
  - guides/targets.txt
461
+ - guides/transports.txt
459
462
  - lib/bolt.rb
460
463
  - lib/bolt/analytics.rb
461
464
  - lib/bolt/applicator.rb