Ensure vm number is specified from cli args

This commit is contained in:
Brian Cain 2015-10-12 09:48:17 -07:00
parent e613a6818d
commit 559005057e
2 changed files with 9 additions and 0 deletions

View file

@ -33,6 +33,10 @@ class Vmfloaty
user = options.user ||= config['user']
url = options.url ||= config['url']
if args.empty?
STDERR.puts "You did not provide any vms to grab"
end
os_types = {}
args.each do |arg|
os_arr = arg.split("=")

View file

@ -33,6 +33,11 @@ class Pooler
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}"
res_body = JSON.parse(response.body)