vmfloaty 0.7.4 → 0.7.5
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 +21 -0
- data/lib/vmfloaty/version.rb +1 -1
- data/lib/vmfloaty.rb +2 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1023c46824f773496c553024460d07e0c0e43e96
|
4
|
+
data.tar.gz: f70276a66a33cbe1ca93e6c9b0e2b51edc5d8c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9eb4fdb7fb89b3a4658d0157acc5d7dc421a1b956cebfb8dbfbe077a4f5455b06d935718537475f2b982c73659accd80d8c377700290c70ee08bb9e607a4f98a
|
7
|
+
data.tar.gz: e6743d018ebb1ea06fd7b92f9c72545094af00ed25e055d70a13e3feaaaefb7f16fd08aebadd85abbeefa204f035a6b8a938520cfaffbb5f652c5fff73f5dad1
|
data/lib/vmfloaty/utils.rb
CHANGED
@@ -92,4 +92,25 @@ class Utils
|
|
92
92
|
running_vms = vms['running']
|
93
93
|
running_vms
|
94
94
|
end
|
95
|
+
|
96
|
+
def self.prettyprint_status(status, message, pools, verbose)
|
97
|
+
pools.select! {|name,pool| pool['ready'] < pool['max']} if ! verbose
|
98
|
+
|
99
|
+
width = pools.keys.map(&:length).max
|
100
|
+
pools.each do |name,pool|
|
101
|
+
begin
|
102
|
+
max = pool['max']
|
103
|
+
ready = pool['ready']
|
104
|
+
pending = pool['pending']
|
105
|
+
missing = max - ready - pending
|
106
|
+
char = 'o'
|
107
|
+
puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}"
|
108
|
+
rescue => e
|
109
|
+
puts "#{name.ljust(width)} #{e.red}"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
puts
|
114
|
+
puts message.colorize(status['status']['ok'] ? :default : :red)
|
115
|
+
end
|
95
116
|
end
|
data/lib/vmfloaty/version.rb
CHANGED
data/lib/vmfloaty.rb
CHANGED
@@ -427,24 +427,7 @@ class Vmfloaty
|
|
427
427
|
if options.json
|
428
428
|
pp status
|
429
429
|
else
|
430
|
-
|
431
|
-
|
432
|
-
width = pools.keys.map(&:length).max
|
433
|
-
pools.each do |name,pool|
|
434
|
-
begin
|
435
|
-
max = pool['max']
|
436
|
-
ready = pool['ready']
|
437
|
-
pending = pool['pending']
|
438
|
-
missing = max - ready - pending
|
439
|
-
char = 'o'
|
440
|
-
puts "#{name.ljust(width)} #{(char*ready).green}#{(char*pending).yellow}#{(char*missing).red}"
|
441
|
-
rescue => e
|
442
|
-
puts "#{name.ljust(width)} #{e.red}"
|
443
|
-
end
|
444
|
-
end
|
445
|
-
|
446
|
-
puts
|
447
|
-
puts message.colorize(status['status']['ok'] ? :default : :red)
|
430
|
+
Utils.prettyprint_status(status, message, pools, verbose)
|
448
431
|
end
|
449
432
|
|
450
433
|
exit status['status']['ok']
|
@@ -464,6 +447,7 @@ class Vmfloaty
|
|
464
447
|
|
465
448
|
summary = Pooler.summary(verbose, url)
|
466
449
|
pp summary
|
450
|
+
exit 0
|
467
451
|
end
|
468
452
|
end
|
469
453
|
|
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.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Cain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|