Class: VagrantPlugins::Destroy::Provisioner
- Inherits:
-
Object
- Object
- VagrantPlugins::Destroy::Provisioner
- Defined in:
- lib/vagrant-destroy-provisioner/provisioner.rb
Instance Method Summary collapse
-
#initialize(machine, config) ⇒ Provisioner
constructor
A new instance of Provisioner.
- #provision ⇒ Object
Constructor Details
#initialize(machine, config) ⇒ Provisioner
Returns a new instance of Provisioner.
4 5 6 7 |
# File 'lib/vagrant-destroy-provisioner/provisioner.rb', line 4 def initialize(machine, config) super @logger = Log4r::Logger.new("vagrant::provisioners::destroy") end |
Instance Method Details
#provision ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-destroy-provisioner/provisioner.rb', line 9 def provision = {} if config.destroy [:force_confirm_destroy] = true @logger.info("VM is going to destroy"); @machine.action(:destroy, ) else @logger.info("VM is going to halt"); @machine.action(:halt, ) end begin sleep 2 end while @machine.communicate.ready? end |