vmfloaty 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a6d9fbc28754d8b0ab518b73f62d6b20057b1d2
4
- data.tar.gz: d328a16a9430b324a4ba5a050f1a72e0c5cf8f53
3
+ metadata.gz: 55d5f11511ad84f602cc136d8d905e913229cf95
4
+ data.tar.gz: 07e4766f0f69c219ab3d9d8cd797d5595f6f254c
5
5
  SHA512:
6
- metadata.gz: d9a5361e957db68222c1112912b17264417d19995f9b31ba7a19f3901454cf94c00d331e348cce6b8565daa0ca51848afb14fcdbd3d468a6548cd7ae68faf7a8
7
- data.tar.gz: 1c1aea226b929c869930c5e65eb6814bc343116ffac03bfd729e0c72e604e5f7071912819769f19c75426798d1f4508caf030be49462686b9dbae22448631fc6
6
+ metadata.gz: cfc3e2dfec7fa52efe13908c89b1ecee23d74daec52e1b989aea6fb06a21c8d5bcfc9ceb69cad02bd58be34c1bb50d9caad9e7fe16a5ea41600d960f3ec8a2d2
7
+ data.tar.gz: b0cbf57fedf7d227914c0de9aa3616fabbcb3b7c7d45be4d0f621330d14d86957060e38898b0684feac3eaccce9fd64e0b8564758984beaa7c3ec2becfef6f05
data/README.md CHANGED
@@ -53,7 +53,7 @@ This command will then ask you to log in. If successful, it will return a token
53
53
  Grabbing vms:
54
54
 
55
55
  ```
56
- floaty get centos-7,debian-7,windows-10 --token mytokenstring --url https://vmpooler.mycompany.net
56
+ floaty get centos-7-x86_64=2 debian-7-x86_64=1 windows-10=3 --token mytokenstring --url https://vmpooler.mycompany.net
57
57
  ```
58
58
 
59
59
  ### vmfloaty dotfile
@@ -19,13 +19,21 @@ class Pooler
19
19
  end
20
20
 
21
21
  def self.retrieve(verbose, os_type, token, url)
22
- os = os_type.gsub(',','+')
23
22
  conn = Http.get_conn(verbose, url)
24
23
  if token
25
24
  conn.headers['X-AUTH-TOKEN'] = token
26
25
  end
27
26
 
28
- response = conn.post "/vm/#{os}"
27
+ os_string = ""
28
+ os_type.each do |os,num|
29
+ num.times do |i|
30
+ os_string << os+"+"
31
+ end
32
+ end
33
+
34
+ os_string = os_string.chomp("+")
35
+
36
+ response = conn.post "/vm/#{os_string}"
29
37
 
30
38
  res_body = JSON.parse(response.body)
31
39
  res_body
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Version
3
- @version = '0.2.6'
3
+ @version = '0.2.7'
4
4
 
5
5
  def self.get
6
6
  @version
data/lib/vmfloaty.rb CHANGED
@@ -18,10 +18,10 @@ class Vmfloaty
18
18
  config = Conf.read_config
19
19
 
20
20
  command :get do |c|
21
- c.syntax = 'floaty get [hostname,...]'
21
+ c.syntax = 'floaty get os_type1=x ox_type2=y ...'
22
22
  c.summary = 'Gets a vm or vms based on the os flag'
23
23
  c.description = ''
24
- c.example 'Gets 3 vms', 'floaty get centos,centos,debian --user brian --url http://vmpooler.example.com'
24
+ c.example 'Gets 3 vms', 'floaty get centos=3 debian=1 --user brian --url http://vmpooler.example.com'
25
25
  c.option '--verbose', 'Enables verbose output'
26
26
  c.option '--user STRING', String, 'User to authenticate with'
27
27
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -32,7 +32,13 @@ class Vmfloaty
32
32
  token = options.token || config['token']
33
33
  user = options.user ||= config['user']
34
34
  url = options.url ||= config['url']
35
- os_types = args[0]
35
+
36
+ os_types = {}
37
+ args.each do |arg|
38
+ os_arr = arg.split("=")
39
+ os_types[os_arr[0]] = os_arr[1].to_i
40
+ end
41
+
36
42
  no_token = options.notoken
37
43
 
38
44
  if no_token
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmfloaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Cain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander