providers/hyperv: usable test
This commit is contained in:
parent
967f7bce1a
commit
740652aef9
|
@ -11,9 +11,7 @@ module VagrantPlugins
|
|||
class Provider < Vagrant.plugin("2", :provider)
|
||||
attr_reader :driver
|
||||
|
||||
def initialize(machine)
|
||||
@machine = machine
|
||||
|
||||
def self.usable?(raise_error=false)
|
||||
if !Vagrant::Util::Platform.windows?
|
||||
raise Errors::WindowsRequired
|
||||
end
|
||||
|
@ -26,6 +24,15 @@ module VagrantPlugins
|
|||
raise Errors::PowerShellRequired
|
||||
end
|
||||
|
||||
true
|
||||
rescue HyperVError
|
||||
raise if raise_error
|
||||
return false
|
||||
end
|
||||
|
||||
def initialize(machine)
|
||||
@machine = machine
|
||||
|
||||
# This method will load in our driver, so we call it now to
|
||||
# initialize it.
|
||||
machine_id_changed
|
||||
|
|
Loading…
Reference in New Issue