mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Standardize 'running' dashboard API output
This commit is contained in:
parent
5e24d1e44e
commit
1668c3245b
2 changed files with 14 additions and 7 deletions
|
|
@ -115,10 +115,11 @@ get '/dashboard/stats/vcloud/running' do
|
|||
|
||||
config[:pools].each do |pool|
|
||||
running = $redis.scard( 'vmware_host_pool__running__' + pool['name'] )
|
||||
|
||||
pool['major'] = $1 if pool['name'] =~ /^(\w+)\-/
|
||||
|
||||
result[pool['major']] = result[pool['major']].to_i + running.to_i
|
||||
result[pool['major']] ||= Hash.new
|
||||
|
||||
result[pool['major']]['running'] = result[pool['major']]['running'].to_i + running.to_i
|
||||
end
|
||||
|
||||
content_type :json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue