mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Simplify how floaty gets vms
Instead of building a json hash for each requested vm, sub the host strings commas with + and append it to the request url.
This commit is contained in:
parent
7fb07a9a69
commit
9fc9820120
2 changed files with 15 additions and 14 deletions
|
|
@ -25,12 +25,20 @@ class Vmfloaty
|
|||
c.option '--url STRING', String, 'URL of vmpooler'
|
||||
c.option '--token STRING', String, 'Token for vmpooler'
|
||||
c.option '--os STRING', String, 'Operating systems to retrieve'
|
||||
c.option '--notoken', 'Makes a request without a token'
|
||||
c.action do |args, options|
|
||||
verbose = options.verbose || config['verbose']
|
||||
token = options.token || config['token']
|
||||
user = options.user ||= config['user']
|
||||
url = options.url ||= config['url']
|
||||
os_types = options.os
|
||||
no_token = options.notoken
|
||||
|
||||
unless no_token.nil?
|
||||
response = Pooler.retrieve(verbose, os_types, token, url)
|
||||
puts response
|
||||
return
|
||||
end
|
||||
|
||||
unless options.token
|
||||
pass = password "Enter your password please:", '*'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue