mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
Ensure vm number is specified from cli args
This commit is contained in:
parent
e613a6818d
commit
559005057e
2 changed files with 9 additions and 0 deletions
|
|
@ -33,6 +33,10 @@ class Vmfloaty
|
||||||
user = options.user ||= config['user']
|
user = options.user ||= config['user']
|
||||||
url = options.url ||= config['url']
|
url = options.url ||= config['url']
|
||||||
|
|
||||||
|
if args.empty?
|
||||||
|
STDERR.puts "You did not provide any vms to grab"
|
||||||
|
end
|
||||||
|
|
||||||
os_types = {}
|
os_types = {}
|
||||||
args.each do |arg|
|
args.each do |arg|
|
||||||
os_arr = arg.split("=")
|
os_arr = arg.split("=")
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,11 @@ class Pooler
|
||||||
|
|
||||||
os_string = os_string.chomp("+")
|
os_string = os_string.chomp("+")
|
||||||
|
|
||||||
|
if os_string.size == 0
|
||||||
|
STDERR.puts "No request was made, os hash specified no vms #{os_type}"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
response = conn.post "/vm/#{os_string}"
|
response = conn.post "/vm/#{os_string}"
|
||||||
|
|
||||||
res_body = JSON.parse(response.body)
|
res_body = JSON.parse(response.body)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue