summaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-02-21 22:54:01 +0000
committerintrigeri <intrigeri@boum.org>2016-02-21 22:54:01 +0000
commit2dfc21d55ba62a83498943a01e9ff30a0db282ca (patch)
treec1cd03680c55533292eb2ff563497fc3737576a6 /Rakefile
parenteea7aad17642c1cbd00575af6ec9fa8a005bfa9b (diff)
Rakefile: make capture_vagrant fatal, and adjust its callers as needed.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index f9ed584..f5cc711 100644
--- a/Rakefile
+++ b/Rakefile
@@ -50,9 +50,14 @@ def run_vagrant(*args)
end
# Runs the vagrant command, not letting stdout/stderr through, and
-# returns [stdout, stderr, Process::Status].
+# returns [stdout, stderr].
def capture_vagrant(*args)
- Open3.capture3('vagrant', *args, :chdir => './vagrant')
+ stdout, stderr, proc_status =
+ Open3.capture3('vagrant', *args, :chdir => './vagrant')
+ if proc_status.exitstatus != 0
+ abort "'vagrant #{*args}' command failed: #{proc_status.exitstatus}"
+ end
+ return stdout, stderr
end
def current_vm_cpus
@@ -60,7 +65,7 @@ def current_vm_cpus
end
def vm_state
- out, _, status = capture_vagrant('status')
+ out, _ = capture_vagrant('status')
status_line = out.split("\n")[2]
if status_line['not created']
return :not_created