Skip to content

Commit ec2e9d2

Browse files
committed
Catch orchestrator errors like "permission denied"
Print better data when something goes wrong. Example: when the token used to connect to the orchestrator is not permitted to perform the requested operation.
1 parent b9641d9 commit ec2e9d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tasks/puppet_infra_upgrade.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ def wait_until_connected(nodes:, token_file:, timeout: 120)
7373
Timeout.timeout(timeout) do
7474
loop do
7575
response = http.request(request)
76-
raise unless response.is_a? Net::HTTPSuccess
76+
unless response.is_a? Net::HTTPSuccess
77+
raise "Unexpected result from orchestrator: #{response.class}\n#{response}"
78+
end
7779
inventory = JSON.parse(response.body)
7880
break if inventory['items'].all? { |item| item['connected'] }
7981
sleep(1)

0 commit comments

Comments
 (0)