lib/testlab/provisioners/shell.rb in testlab-0.6.16 vs lib/testlab/provisioners/shell.rb in testlab-0.6.17

- old
+ new

@@ -10,12 +10,12 @@ # @author Zachary Patten <zachary AT jovelabs DOT com> class Shell require 'tempfile' def initialize(config={}, ui=nil) + @ui = (ui || TestLab.ui) @config = (config || Hash.new) - @ui = (ui || TestLab.ui) end # Shell Provisioner Container Setup # # Renders the defined script to a temporary file on the target container @@ -23,12 +23,12 @@ # # @param [TestLab::Container] container The container which we want to # provision. # @return [Boolean] True if successful. def on_container_setup(container) - if !@config[:script].nil? - container.bootstrap(@config[:script]) - end + @config[:script].nil? and raise ShellError, "You must supply a script to bootstrap!" + + container.bootstrap(@config[:script]) true end end