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 +4 -4
- data/lib/vmfloaty/utils.rb +22 -9
- data/lib/vmfloaty/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c71ad65fbb59dddbde17fc14fb0b1bc49572f64
|
4
|
+
data.tar.gz: a2e0f6e4903c90cc6413c1def095c813632171aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 033fae57507ef2830d2a587393039923a492575a14a1467532278da69a61e0fc9a0a8385bb68910fe568d9c1b24d22714bb300b5b65068a87c1110ae3c8a51b4
|
7
|
+
data.tar.gz: 3d6a077bf67007928f535f55d7142f27e4cbde3dc1c23ef00b00d16b6aa90408dd66c99d69ba2e846034eb13c8f8ac7f294356ec9b8d36e4efa0f5133aa5f4f5
|
data/lib/vmfloaty/utils.rb
CHANGED
@@ -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
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
-
|
55
|
-
end
|
68
|
+
puts "- #{vm}.#{domain} (#{template}, #{running}/#{lifetime} hours)"
|
56
69
|
end
|
57
70
|
end
|
58
71
|
end
|
data/lib/vmfloaty/version.rb
CHANGED