lib/testlab/providers/vagrant.rb in testlab-1.4.4 vs lib/testlab/providers/vagrant.rb in testlab-1.5.0
- old
+ new
@@ -27,12 +27,10 @@
INVALID_STATES = (%w(not_created).map(&:to_sym) + [UNKNOWN_STATE]).flatten
# A collection of all states the VM can be in
ALL_STATES = (VALID_STATES + INVALID_STATES).flatten
- MSG_NO_LAB = %(We could not find a test lab!)
-
################################################################################
def initialize(config={}, ui=nil)
@config = (config || Hash.new)
@ui = (ui || TestLab.ui)
@@ -48,12 +46,10 @@
true
end
# Destroy Vagrant-controlled VM
def destroy
- !self.exists? and raise VagrantError, MSG_NO_LAB
-
self.alive? and self.down
self.exists? and self.vagrant_cli("destroy", "--force", self.instance_id)
true
end
@@ -69,11 +65,9 @@
true
end
# Halt Vagrant-controlled VM
def down(*args)
- !self.exists? and raise VagrantError, MSG_NO_LAB
-
arguments = (%W(halt #{self.instance_id}) + args).flatten.compact
self.vagrant_cli(*arguments)
true