Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
# Disable analytics when running in development
ENV['BOLT_DISABLE_ANALYTICS'] = 'true'

# Disable warning that Bolt may be installed as a gem
ENV['BOLT_GEM'] = 'true'

gemspec

# Optional paint gem for rainbow outputter
Expand Down
18 changes: 0 additions & 18 deletions lib/bolt/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ def execute(options)
# FINALIZING SETUP
#

check_gem_install
warn_inventory_overrides_cli(config, options)
submit_screen_view(analytics, config, inventory, options)
options[:targets] = process_target_list(plugins, @rerun, options)
Expand Down Expand Up @@ -769,23 +768,6 @@ def execute(options)
content
end

# Check and warn if Bolt is installed as a gem.
#
private def check_gem_install
if ENV['BOLT_GEM'].nil? && incomplete_install?
msg = <<~MSG.chomp
Bolt might be installed as a gem. To use Bolt reliably and with all of its
dependencies, uninstall the 'bolt' gem and install Bolt as a package:
https://puppet.com/docs/bolt/latest/bolt_installing.html

If you meant to install Bolt as a gem and want to disable this warning,
set the BOLT_GEM environment variable.
MSG

Bolt::Logger.warn("gem_install", msg)
end
end

# Print a fatal error. Print using the outputter if it's configured.
# Otherwise, mock the output by printing directly to stdout.
#
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/transport/local_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def make_target
expect(runner.upload(target, file.path, dest, run_as: user).message).to match(/Uploaded/)
expect(runner.run_command(target, "cat #{dest}", run_as: user)['stdout']).to eq(contents)
expect(runner.run_command(target, "stat -c %U #{dest}", run_as: user)['stdout'].chomp).to eq(user)
expect(runner.run_command(target, "stat -c %G #{dest}", run_as: user)['stdout'].chomp).to eq('docker')
expect(runner.run_command(target, "stat -c %G #{dest}", run_as: user)['stdout'].chomp).to eq('runner')
end

runner.run_command(target, "rm #{dest}", sudoable: true, run_as: user)
Expand Down
18 changes: 0 additions & 18 deletions spec/unit/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,24 +485,6 @@
end
end

describe 'checking for gem install' do
it 'displays a warning when Bolt is installed as a gem' do
with_env_vars('BOLT_GEM' => nil) do
allow(cli).to receive(:incomplete_install?).and_return(true)
expect(Bolt::Logger).to receive(:warn).with('gem_install', anything)
cli.execute({})
end
end

it 'does not display a warning when BOLT_GEM is set' do
with_env_vars('BOLT_GEM' => 'true') do
allow(cli).to receive(:incomplete_install?).and_return(true)
cli.execute({})
expect(Bolt::Logger).not_to receive(:warn).with('gem_install', anything)
end
end
end

describe 'analytics' do
before(:each) do
allow(cli).to receive(:submit_screen_view).and_call_original
Expand Down
Loading