cucumber-chef 2.1.0.rc.9 → 2.1.0.rc.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cucumber/chef/providers/vagrant.rb +11 -4
- data/lib/cucumber/chef/version.rb +1 -1
- metadata +1 -1
@@ -27,7 +27,7 @@ module Cucumber
|
|
27
27
|
class Vagrant
|
28
28
|
# attr_accessor :env, :vm
|
29
29
|
|
30
|
-
INVALID_STATES = %w(not_created aborted).map(&:to_sym)
|
30
|
+
INVALID_STATES = %w(not_created aborted unknown).map(&:to_sym)
|
31
31
|
RUNNING_STATES = %w(running).map(&:to_sym)
|
32
32
|
SHUTDOWN_STATES = %w(paused saved poweroff).map(&:to_sym)
|
33
33
|
VALID_STATES = RUNNING_STATES+SHUTDOWN_STATES
|
@@ -131,7 +131,7 @@ module Cucumber
|
|
131
131
|
################################################################################
|
132
132
|
|
133
133
|
def exists?
|
134
|
-
(
|
134
|
+
(self.state != :not_created)
|
135
135
|
end
|
136
136
|
|
137
137
|
def alive?
|
@@ -150,8 +150,15 @@ module Cucumber
|
|
150
150
|
end
|
151
151
|
|
152
152
|
def state
|
153
|
-
|
154
|
-
|
153
|
+
output = self.vagrant_cli("status").output
|
154
|
+
result = :unknown
|
155
|
+
(VALID_STATES+INVALID_STATES).each do |state|
|
156
|
+
if output =~ /#{state}/
|
157
|
+
result = state
|
158
|
+
break
|
159
|
+
end
|
160
|
+
end
|
161
|
+
result.to_sym
|
155
162
|
end
|
156
163
|
|
157
164
|
def username
|
@@ -24,7 +24,7 @@ module Cucumber
|
|
24
24
|
|
25
25
|
################################################################################
|
26
26
|
|
27
|
-
VERSION = "2.1.0.rc.
|
27
|
+
VERSION = "2.1.0.rc.10" unless const_defined?(:VERSION)
|
28
28
|
|
29
29
|
################################################################################
|
30
30
|
|