mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
Add default for grabbing an os
If a user does not specify a number of vms with the get command (i.e. does not include an = sign after the os), the get command will assume the user just wants 1 vm.
This commit is contained in:
parent
4cf77bc4d4
commit
3a17b418cf
1 changed files with 6 additions and 1 deletions
|
|
@ -41,8 +41,13 @@ class Vmfloaty
|
||||||
os_types = {}
|
os_types = {}
|
||||||
args.each do |arg|
|
args.each do |arg|
|
||||||
os_arr = arg.split("=")
|
os_arr = arg.split("=")
|
||||||
|
if os_arr.size == 1
|
||||||
|
# assume they didn't specify an = sign if split returns 1 size
|
||||||
|
os_types[os_arr[0]] = 1
|
||||||
|
else
|
||||||
os_types[os_arr[0]] = os_arr[1].to_i
|
os_types[os_arr[0]] = os_arr[1].to_i
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
no_token = options.notoken
|
no_token = options.notoken
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue