mirror of
https://github.com/puppetlabs/vmpooler-provider-vsphere.git
synced 2026-01-26 03:18:41 -05:00
Merge pull request #51 from puppetlabs/fix_redis_commands
(maint) Convert booleans and Time objects to strings when being added to redis
This commit is contained in:
commit
24204421c6
1 changed files with 2 additions and 2 deletions
|
|
@ -71,7 +71,7 @@ module Vmpooler
|
||||||
redis.multi do |transaction|
|
redis.multi do |transaction|
|
||||||
transaction.srem("vmpooler__completed__#{pool}", vm_name)
|
transaction.srem("vmpooler__completed__#{pool}", vm_name)
|
||||||
transaction.hdel("vmpooler__active__#{pool}", vm_name)
|
transaction.hdel("vmpooler__active__#{pool}", vm_name)
|
||||||
transaction.hset("vmpooler__vm__#{vm_name}", 'destroy', Time.now)
|
transaction.hset("vmpooler__vm__#{vm_name}", 'destroy', Time.now.to_s)
|
||||||
|
|
||||||
# Auto-expire metadata key
|
# Auto-expire metadata key
|
||||||
transaction.expire("vmpooler__vm__#{vm_name}", (data_ttl * 60 * 60))
|
transaction.expire("vmpooler__vm__#{vm_name}", (data_ttl * 60 * 60))
|
||||||
|
|
@ -1139,7 +1139,7 @@ module Vmpooler
|
||||||
@redis.with_metrics do |redis|
|
@redis.with_metrics do |redis|
|
||||||
redis.multi do |transaction|
|
redis.multi do |transaction|
|
||||||
transaction.hset("vmpooler__vm__#{vm_name}", 'host', target_host_name)
|
transaction.hset("vmpooler__vm__#{vm_name}", 'host', target_host_name)
|
||||||
transaction.hset("vmpooler__vm__#{vm_name}", 'migrated', true)
|
transaction.hset("vmpooler__vm__#{vm_name}", 'migrated', 'true')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
logger.log('s', "[>] [#{pool_name}] '#{vm_name}' migrated from #{vm_hash['host_name']} to #{target_host_name} in #{finish} seconds")
|
logger.log('s', "[>] [#{pool_name}] '#{vm_name}' migrated from #{vm_hash['host_name']} to #{target_host_name} in #{finish} seconds")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue