mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
(#25) Remove printing from delete method in pooler api
This commit is contained in:
parent
a6c5f1dceb
commit
5f6cd1df1d
4 changed files with 16 additions and 10 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
class Version
|
||||
@version = '0.4.0'
|
||||
@version = '0.5.0'
|
||||
|
||||
def self.get
|
||||
@version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue