Skip to content

Commit d09cba4

Browse files
committed
(maint) Remove unnecessary condition
Commit 2e24fb7 ensures we no longer push nil on the context. As a result, we can remove the nil check inside the block, and specify the `master_used` in the else clause.
1 parent 65bbfe0 commit d09cba4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/puppet/configurer.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,12 @@ def run(options = {})
222222
found = find_functional_server()
223223
server = found[:server]
224224
if server.nil?
225-
raise Puppet::Error, _("Could not select a functional puppet master from server_list: '%{server_list}'") % { server_list: Puppet.settings[:server_list] }
225+
raise Puppet::Error, _("Could not select a functional puppet master from server_list: '%{server_list}'") % { server_list: Puppet[:server_list] }
226+
else
227+
Puppet.debug "Selected master: #{server[0]}:#{server[1]}"
228+
report.master_used = "#{server[0]}:#{server[1]}"
226229
end
227230
Puppet.override(:server => server[0], :serverport => server[1]) do
228-
if !server.first.nil?
229-
Puppet.debug "Selected master: #{server[0]}:#{server[1]}"
230-
report.master_used = "#{server[0]}:#{server[1]}"
231-
end
232-
233231
completed = run_internal(options.merge(:node => found[:node]))
234232
end
235233
else

0 commit comments

Comments
 (0)