mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Merge pull request #55 from highb/add_handling_for_failed_modify_request
Update pooler provider to throw an exception if the API returns non-OK
This commit is contained in:
commit
7d0a72517b
1 changed files with 8 additions and 1 deletions
|
|
@ -72,7 +72,14 @@ class Pooler
|
||||||
end
|
end
|
||||||
|
|
||||||
res_body = JSON.parse(response.body)
|
res_body = JSON.parse(response.body)
|
||||||
res_body
|
|
||||||
|
if res_body['ok']
|
||||||
|
res_body
|
||||||
|
elsif response.status == 401
|
||||||
|
raise AuthError, "HTTP #{response.status}: The token provided could not authenticate to the pooler.\n#{res_body}"
|
||||||
|
else
|
||||||
|
raise ModifyError, "HTTP #{response.status}: Failed to modify VMs from the pooler vm/#{hostname}. #{res_body}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.disk(verbose, url, hostname, token, disk)
|
def self.disk(verbose, url, hostname, token, disk)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue