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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8de23f57fada51a83c244675daa1836cc60fc9e
4
- data.tar.gz: c6fa434dc8404d590b309a45121745149d6e0d10
3
+ metadata.gz: 1023c46824f773496c553024460d07e0c0e43e96
4
+ data.tar.gz: f70276a66a33cbe1ca93e6c9b0e2b51edc5d8c19
5
5
  SHA512:
6
- metadata.gz: 9e0408ff22f063cef2b84043e1424f169d0802f62c6b5064331d7adbaa1535474bd146631476bb746d5d85a1f64b4ecfb83d73c192bf470775707d08368df939
7
- data.tar.gz: 4d24e1ef6b095070418929c3aa79ec75f602028fe9f58245db64bafbe66bb0beb81bf704b00376148102418bcfbf5b0880c8c98c857dda31b6fbcb3995c911bb
6
+ metadata.gz: 9eb4fdb7fb89b3a4658d0157acc5d7dc421a1b956cebfb8dbfbe077a4f5455b06d935718537475f2b982c73659accd80d8c377700290c70ee08bb9e607a4f98a
7
+ data.tar.gz: e6743d018ebb1ea06fd7b92f9c72545094af00ed25e055d70a13e3feaaaefb7f16fd08aebadd85abbeefa204f035a6b8a938520cfaffbb5f652c5fff73f5dad1
@@ -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
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Version
3
- @version = '0.7.4'
3
+ @version = '0.7.5'
4
4
 
5
5
  def self.get
6
6
  @version
data/lib/vmfloaty.rb CHANGED
@@ -427,24 +427,7 @@ class Vmfloaty
427
427
  if options.json
428
428
  pp status
429
429
  else
430
- pools.select! {|name,pool| pool['ready'] < pool['max']} if ! verbose
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
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-05 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander