Class: Kitchen::Driver::Vmpool

Inherits:
Base
  • Object
show all
Includes:
Logging
Defined in:
lib/kitchen/driver/vmpool.rb

Instance Method Summary collapse

Instance Method Details

#create(state) ⇒ Object



44
45
46
47
48
# File 'lib/kitchen/driver/vmpool.rb', line 44

def create(state)
  member = store.take_pool_member(config[:pool_name])
  info("Pool member #{member} was selected")
  state[:hostname] = member
end

#destroy(state) ⇒ Object



51
52
53
54
55
56
57
58
59
60
# File 'lib/kitchen/driver/vmpool.rb', line 51

def destroy(state)
  return if state[:hostname].nil?
  store.mark_unused(state[:hostname], config[:pool_name], config[:reuse_instances])
  if config[:reuse_instances]
    info("Marking pool member #{name} as unused")
  else
    info("Marking pool member #{name} as used")
  end
  state.delete(:hostname)
end