Merge pull request #469 from puppetlabs/tag_vm_user

(maint) Adding a provider method tag_vm_user
This commit is contained in:
Gene Liverman 2021-12-09 13:41:30 -05:00 committed by GitHub
commit 7872bfe8fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 0 deletions

View file

@ -294,6 +294,12 @@ module Vmpooler
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is listed as running, but has no checkouttime data. Removing from running')
end
# tag VM if not tagged yet, this ensures the method is only called once
unless redis.hget("vmpooler__vm__#{vm}", 'user_tagged')
success = provider.tag_vm_user(pool, vm)
redis.hset("vmpooler__vm__#{vm}", 'user_tagged', 'true') if success
end
throw :stop_checking if provider.vm_ready?(pool, vm)
throw :stop_checking if provider.get_vm(pool, vm)