mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
Remove abs eval from GET, rework spec tests to check each field.
This allows us to account for "flakiness" of the remaining return.
This commit is contained in:
parent
f95b878c8a
commit
d602057cf2
2 changed files with 11 additions and 15 deletions
|
|
@ -645,7 +645,7 @@ module Vmpooler
|
|||
result[params[:hostname]]['state'] = 'destroyed'
|
||||
elsif rdata['checkout']
|
||||
result[params[:hostname]]['running'] = ((Time.now - Time.parse(rdata['checkout'])) / 60 / 60).round(2)
|
||||
result[params[:hostname]]['remaining'] = ((Time.parse(rdata['checkout']) + rdata['lifetime'].to_i*60*60 - Time.now) / 60 / 60).round(2).abs
|
||||
result[params[:hostname]]['remaining'] = ((Time.parse(rdata['checkout']) + rdata['lifetime'].to_i*60*60 - Time.now) / 60 / 60).round(2)
|
||||
result[params[:hostname]]['start_time'] = Time.parse(rdata['checkout'])
|
||||
result[params[:hostname]]['end_time'] = Time.parse(rdata['checkout']) + rdata['lifetime'].to_i*60*60
|
||||
result[params[:hostname]]['state'] = 'running'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue