Class: Kitchen::Driver::Localhost

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/driver/localhost.rb

Overview

Localhost driver for Kitchen.

Author:

Instance Method Summary collapse

Instance Method Details

#create(state) ⇒ Object

Create the temp dirs on the local filesystem for Kitchen.

(see Base#create)



41
42
43
44
# File 'lib/kitchen/driver/localhost.rb', line 41

def create(state)
  state[:hostname] = Socket.gethostname
  logger.info("[Localhost] Instance #{instance} ready.")
end

#destroy(_) ⇒ Object

Clean up the temp dirs left behind

(see Base#destroy)



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

def destroy(_)
  paths = [
    instance.provisioner[:root_path], instance.verifier[:root_path]
  ]
  paths.each do |p|
    FileUtils.rm_rf(p)
    logger.info("[Localhost] Deleted temp dir '#{p}'.")
  end
end