File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,7 @@ def run(options = {})
222222 found = find_functional_server ( )
223223 server = found [ :server ]
224224 if server . nil?
225- Puppet . warning _ ( "Could not select a functional puppet master" )
226- server = [ nil , nil ]
225+ raise Puppet ::Error , _ ( "Could not select a functional puppet master from server_list: '%{server_list}'" ) % { server_list : Puppet . settings [ :server_list ] }
227226 end
228227 Puppet . override ( :server => server [ 0 ] , :serverport => server [ 1 ] ) do
229228 if !server . first . nil?
Original file line number Diff line number Diff line change @@ -1027,17 +1027,15 @@ def expects_neither_new_or_cached_catalog
10271027 @agent . run
10281028 end
10291029
1030- it "should fallback to an empty server when failover fails " do
1030+ it "should error when no servers in 'server_list' are reachable " do
10311031 Puppet . settings [ :server_list ] = [ "myserver:123" ]
10321032 pool = Puppet ::Network ::HTTP ::Pool . new ( Puppet [ :http_keepalive_timeout ] )
10331033 Puppet ::Network ::HTTP ::Pool . expects ( :new ) . returns ( pool )
10341034 Puppet . expects ( :override ) . with ( { :http_pool => pool } ) . yields
10351035 Puppet . expects ( :override ) . with ( { :server => "myserver" , :serverport => '123' } ) . yields
1036- Puppet . expects ( :override ) . with ( { :server => nil , :serverport => nil } ) . yields
10371036 error = Net ::HTTPError . new ( 400 , 'dummy server communication error' )
10381037 Puppet ::Node . indirection . expects ( :find ) . raises ( error )
1039- @agent . expects ( :run_internal ) . returns ( nil )
1040- @agent . run
1038+ expect { @agent . run } . to raise_error ( Puppet ::Error , /Could not select a functional puppet master from server_list/ )
10411039 end
10421040
10431041 it "should not make multiple node requets when the server is found" do
You can’t perform that action at this time.
0 commit comments