Skip to content

Commit c879918

Browse files
authored
Merge pull request #101 from trevor-vaughan/cleanup_failed_provisioning
Rearrange the cleanup handling
2 parents 34db842 + fe5e4f7 commit c879918

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

lib/beaker-rspec/spec_helper.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,24 @@
4747

4848
# Configure all nodes in nodeset
4949
c.setup([fresh_nodes, '--hosts', nodesetfile, keyfile, debug, color, options_file].flatten.compact)
50-
c.provision
51-
c.validate
52-
c.configure
5350

5451
trap "SIGINT" do
5552
c.cleanup
5653
exit!(1)
5754
end
5855

56+
begin
57+
c.provision
58+
rescue StandardError => e
59+
logger.error(e)
60+
logger.info(e.backtrace)
61+
c.cleanup
62+
exit!(1)
63+
end
64+
65+
c.validate
66+
c.configure
67+
5968
# Destroy nodes if no preserve hosts
6069
c.after :suite do
6170
case options[:destroy]

0 commit comments

Comments
 (0)