'booting' metric should never be a negative number

This commit is contained in:
Scott Schneider 2014-02-05 11:44:26 -08:00
parent 693abcd2ff
commit f9c9c36173

View file

@ -51,6 +51,7 @@ get '/dashboard/stats/vcloud/numbers' do
result['cloning'] = $redis.get( 'vmware_host_pool__tasks__clone' )
result['booting'] = result['pending'].to_i - result['cloning'].to_i
result['booting'] = 0 if result['booting'] < 0
result['total'] = result['pending'].to_i + result['ready'].to_i + result['running'].to_i + result['completed'].to_i
content_type :json