mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
(maint) Have pooler delete class take array
Prior to this commit, the pooler class was expecting a comma separated string of hosts to delete. This commit updates that to expect hostnames to be an array instead.
This commit is contained in:
parent
fa92da5c05
commit
bc4cff5363
3 changed files with 9 additions and 9 deletions
|
|
@ -144,10 +144,16 @@ class Vmfloaty
|
|||
c.option '--url STRING', String, 'URL of vmpooler'
|
||||
c.action do |args, options|
|
||||
verbose = options.verbose || config['verbose']
|
||||
hosts = args[0]
|
||||
hostnames = args[0]
|
||||
token = options.token || config['token']
|
||||
url = options.url ||= config['url']
|
||||
|
||||
if hostnames.nil?
|
||||
STDERR.puts "You did not provide any hosts to delete"
|
||||
exit 1
|
||||
end
|
||||
|
||||
hosts = hostnames.split(',')
|
||||
Pooler.delete(verbose, url, hosts, token)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -71,13 +71,7 @@ class Pooler
|
|||
res_body
|
||||
end
|
||||
|
||||
def self.delete(verbose, url, hostnames, token)
|
||||
if hostnames.nil?
|
||||
STDERR.puts "You did not provide any hosts to delete"
|
||||
exit 1
|
||||
end
|
||||
|
||||
hosts = hostnames.split(',')
|
||||
def self.delete(verbose, url, hosts, token)
|
||||
conn = Http.get_conn(verbose, url)
|
||||
|
||||
if token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue