Forced halts work
This commit is contained in:
parent
f7b39476a0
commit
aa980f2234
|
@ -5,13 +5,13 @@ module VagrantPlugins
|
||||||
class Command < Vagrant.plugin("2", :command)
|
class Command < Vagrant.plugin("2", :command)
|
||||||
def execute
|
def execute
|
||||||
options = {}
|
options = {}
|
||||||
|
options[:force] = false
|
||||||
|
|
||||||
opts = OptionParser.new do |opts|
|
opts = OptionParser.new do |o|
|
||||||
opts.banner = "Usage: vagrant halt [vm-name] [--force] [-h]"
|
o.banner = "Usage: vagrant halt [vm-name] [--force] [-h]"
|
||||||
|
o.separator ""
|
||||||
|
|
||||||
opts.separator ""
|
o.on("-f", "--force", "Force shut down (equivalent of pulling power)") do |f|
|
||||||
|
|
||||||
opts.on("-f", "--force", "Force shut down (equivalent of pulling power)") do |f|
|
|
||||||
options[:force] = f
|
options[:force] = f
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -22,8 +22,7 @@ module VagrantPlugins
|
||||||
|
|
||||||
@logger.debug("Halt command: #{argv.inspect} #{options.inspect}")
|
@logger.debug("Halt command: #{argv.inspect} #{options.inspect}")
|
||||||
with_target_vms(argv) do |vm|
|
with_target_vms(argv) do |vm|
|
||||||
# XXX: "force"
|
vm.action(:halt, :force_halt => options[:force])
|
||||||
vm.action(:halt)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Success, exit status 0
|
# Success, exit status 0
|
||||||
|
|
Loading…
Reference in New Issue