mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
Fixed remove_excess_vms test
This commit is contained in:
parent
0126c305ec
commit
1890344d7d
2 changed files with 21 additions and 20 deletions
|
|
@ -661,7 +661,9 @@ module Vmpooler
|
|||
$logger.log('s', "[*] [#{pool['name']}] is ready for use")
|
||||
end
|
||||
|
||||
def remove_excess_vms(pool, provider, ready, total)
|
||||
def remove_excess_vms(pool)
|
||||
ready = $redis.scard("vmpooler__ready__#{pool['name']}")
|
||||
total = $redis.scard("vmpooler__pending__#{pool['name']}") + ready
|
||||
return if total.nil?
|
||||
return if total == 0
|
||||
mutex = pool_mutex(pool['name'])
|
||||
|
|
@ -893,11 +895,8 @@ module Vmpooler
|
|||
|
||||
repopulate_pool_vms(pool['name'], provider, pool_check_response, pool['size'])
|
||||
|
||||
# query redis again until we refactor remove_excess_vms, duplicate of a line moved to refactored method repopulate_pool_vms
|
||||
ready = $redis.scard("vmpooler__ready__#{pool['name']}")
|
||||
total = $redis.scard("vmpooler__pending__#{pool['name']}") + ready
|
||||
# Remove VMs in excess of the configured pool size
|
||||
remove_excess_vms(pool, provider, ready, total)
|
||||
remove_excess_vms(pool)
|
||||
|
||||
pool_check_response
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue