vmfloaty 0.2.18 → 0.2.19

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: 7039189689c027d1c90c47fce96049c0a876a8e5
4
- data.tar.gz: f5ec0844421b9f8fb970335f8b7ae0382fdeb441
3
+ metadata.gz: 5c71ad65fbb59dddbde17fc14fb0b1bc49572f64
4
+ data.tar.gz: a2e0f6e4903c90cc6413c1def095c813632171aa
5
5
  SHA512:
6
- metadata.gz: 7775b4c7efd851d909be7705249068c7d8b150b7e722411baf9257d4e3be3d0371e6581a981b00c9f24b4de03eae6d8de52953c3da2bc9982a03b6bc79fe90c0
7
- data.tar.gz: 7142c0948f2922277986bc9169cda6698721e3789ececb782d619b2c0c0e58eaa09b533476002476b4503713098e41974cea9bba5b5d0e76b4e522a89f814dbb
6
+ metadata.gz: 033fae57507ef2830d2a587393039923a492575a14a1467532278da69a61e0fc9a0a8385bb68910fe568d9c1b24d22714bb300b5b65068a87c1110ae3c8a51b4
7
+ data.tar.gz: 3d6a077bf67007928f535f55d7142f27e4cbde3dc1c23ef00b00d16b6aa90408dd66c99d69ba2e846034eb13c8f8ac7f294356ec9b8d36e4efa0f5133aa5f4f5
@@ -41,18 +41,31 @@ class Utils
41
41
  os_types
42
42
  end
43
43
 
44
+ def self.get_vm_info(hosts, verbose, url)
45
+ vms = {}
46
+ hosts.each do |host|
47
+ vm_info = Pooler.query(verbose, url, host)
48
+ if vm_info['ok']
49
+ vms[host] = {}
50
+ vms[host]['domain'] = vm_info[host]['domain']
51
+ vms[host]['template'] = vm_info[host]['template']
52
+ vms[host]['lifetime'] = vm_info[host]['lifetime']
53
+ vms[host]['running'] = vm_info[host]['running']
54
+ end
55
+ end
56
+ vms
57
+ end
58
+
44
59
  def self.prettyprint_hosts(hosts, verbose, url)
45
60
  puts "Running VMs:"
46
- hosts.each do |vm|
47
- vm_info = Pooler.query(verbose, url, vm)
48
- if vm_info['ok']
49
- domain = vm_info[vm]['domain']
50
- template = vm_info[vm]['template']
51
- lifetime = vm_info[vm]['lifetime']
52
- running = vm_info[vm]['running']
61
+ vm_info = get_vm_info(hosts, verbose, url)
62
+ vm_info.each do |vm,info|
63
+ domain = info['domain']
64
+ template = info['template']
65
+ lifetime = info['lifetime']
66
+ running = info['running']
53
67
 
54
- puts "- #{vm}.#{domain} (#{template}, #{running}/#{lifetime} hours)"
55
- end
68
+ puts "- #{vm}.#{domain} (#{template}, #{running}/#{lifetime} hours)"
56
69
  end
57
70
  end
58
71
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Version
3
- @version = '0.2.18'
3
+ @version = '0.2.19'
4
4
 
5
5
  def self.get
6
6
  @version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmfloaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Cain