Skip to content

Commit

Permalink
(maint) Merge up master into main
Browse files Browse the repository at this point in the history
* Commits:
  (maint) Remove ignored paths from GitHub Actions
  (PUP-10648) simplify code and remove exception usage

* Conflicts:
	.github/workflows/rspec_tests.yaml - replaced keyword master
with main
	lib/puppet/configurer.rb - wrong identation issue
  • Loading branch information
luchihoratiu committed Oct 19, 2020
2 parents 16110c8 + d94903a commit 57c25f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/rspec_tests.yaml
Expand Up @@ -4,9 +4,8 @@ name: RSpec tests
on:
push:
branches: [main]
paths-ignore: ['**.md', 'docs/*', 'examples/*', 'ext/*', 'benchmarks/*']
pull_request:
paths-ignore: ['**.md', 'docs/*', 'examples/*', 'ext/*', 'benchmarks/*']
branches: [main]

jobs:
rspec_tests:
Expand Down
25 changes: 12 additions & 13 deletions lib/puppet/configurer.rb
Expand Up @@ -221,24 +221,23 @@ def run(options = {})
# mode. We shouldn't try to do any failover in that case.
if options[:catalog].nil? && do_failover
server, port = find_functional_server
begin
if server.nil?
raise Puppet::Error, _("Could not select a functional puppet server from server_list: '%{server_list}'") % { server_list: Puppet.settings.value(:server_list, Puppet[:environment].to_sym, true) }
else
report.server_used = "#{server}:#{port}"
end
rescue Puppet::Error => detail
if server.nil?
detail = _("Could not select a functional puppet server from server_list: '%{server_list}'") % { server_list: Puppet.settings.value(:server_list, Puppet[:environment].to_sym, true) }
if Puppet[:usecacheonfailure]
options[:pluginsync] = false
@running_failure = true
if server.nil?
server = Puppet[:server_list].first[0]
port = Puppet[:server_list].first[1] || Puppet[:serverport]
end
Puppet.log_exception(detail)

server = Puppet[:server_list].first[0]
port = Puppet[:server_list].first[1] || Puppet[:serverport]

Puppet.err(detail)
else
raise detail
raise Puppet::Error, detail
end
else
#TRANSLATORS 'server_list' is the name of a setting and should not be translated
Puppet.debug _("Selected puppet server from the `server_list` setting: %{server}:%{port}") % { server: server, port: port }
report.server_used = "#{server}:#{port}"
end
Puppet.override(server: server, serverport: port) do
completed = run_internal(options)
Expand Down

0 comments on commit 57c25f8

Please sign in to comment.