(#25) Remove printing from delete method in pooler api

This commit is contained in:
Brian Cain 2016-07-09 19:53:12 -07:00
parent a6c5f1dceb
commit 5f6cd1df1d
4 changed files with 16 additions and 10 deletions

View file

@ -212,7 +212,14 @@ class Vmfloaty
if ans
# delete vms
Pooler.delete(verbose, url, running_vms, token)
puts "Scheduling all vms for for deletion"
response = Pooler.delete(verbose, url, running_vms, token)
response.each do |host,vals|
if vals['ok'] == false
STDERR.puts "There was a problem with your request for vm #{host}."
STDERR.puts vals
end
end
end
end

View file

@ -85,17 +85,15 @@ class Pooler
conn.headers['X-AUTH-TOKEN'] = token
end
response_body = {}
hosts.each do |host|
puts "Scheduling host #{host} for deletion"
response = conn.delete "vm/#{host}"
res_body = JSON.parse(response.body)
if res_body['ok']
puts "Deletion for vm #{host} successfully scheduled"
else
STDERR.puts "There was a problem with your request for vm #{host}."
STDERR.puts res_body
end
response_body[host] = res_body
end
response_body
end
def self.status(verbose, url)

View file

@ -1,6 +1,6 @@
class Version
@version = '0.4.0'
@version = '0.5.0'
def self.get
@version