Class: VagrantPlugins::ProviderZone::Command::RestartGuest

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-zones/command/restart_guest.rb

Overview

This is used to restart the guest from inside the guest

Instance Method Summary collapse

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant-zones/command/restart_guest.rb', line 8

def execute
  opts = OptionParser.new do |o|
    o.banner = 'Usage: vagrant zone control restart [options]'
  end

  argv = parse_options(opts)
  return unless argv

  unless argv.empty?
    @env.ui.info(opts.help)
    return
  end

  ## Wait for VM up
  with_target_vms(argv, provider: :zone) do |machine|
    machine.action('restart')
  end
end