mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
f pool_manager
This commit is contained in:
parent
7154b48e04
commit
c067f85006
1 changed files with 7 additions and 3 deletions
|
|
@ -19,8 +19,8 @@ module Vmpooler
|
|||
$threads = {}
|
||||
|
||||
# WARNING DEBUG
|
||||
$logger.log('d',"Flushing REDIS WARNING!!!")
|
||||
$redis.flushdb
|
||||
#$logger.log('d',"Flushing REDIS WARNING!!!")
|
||||
#$redis.flushdb
|
||||
end
|
||||
|
||||
# Check the state of a VM
|
||||
|
|
@ -60,7 +60,7 @@ module Vmpooler
|
|||
# DONE
|
||||
def fail_pending_vm(vm, pool, timeout, exists=true)
|
||||
clone_stamp = $redis.hget("vmpooler__vm__#{vm}", 'clone')
|
||||
return if ! clone_stamp
|
||||
return true if ! clone_stamp
|
||||
|
||||
time_since_clone = (Time.now - Time.parse(clone_stamp)) / 60
|
||||
if time_since_clone > timeout
|
||||
|
|
@ -71,8 +71,12 @@ module Vmpooler
|
|||
remove_nonexistent_vm(vm, pool)
|
||||
end
|
||||
end
|
||||
|
||||
true
|
||||
rescue => err
|
||||
$logger.log('d', "Fail pending VM failed with an error: #{err}")
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
# DONE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue