Sha256: 3f42ef7458537fd2cedac69877463605f1be27ba8b799c9482644df0762c3b87

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

class TestLab

  class Provisioner

    # Shell Provisioner Error Class
    class ShellError < ProvisionerError; end

    # Shell Provisioner Class
    #
    # @author Zachary Patten <zachary AT jovelabs DOT com>
    class Shell
      require 'tempfile'

      def initialize(config={}, ui=nil)
        @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
      # and proceeds to execute said script as root via *lxc-attach*.
      #
      # @param [TestLab::Container] container The container which we want to
      #   provision.
      # @return [Boolean] True if successful.
      def setup(container)
        if !@config[:setup].nil?
          container.bootstrap(@config[:setup])
        end

        true
      end

      # Shell Provisioner Container Teardown
      #
      # This is a NO-OP currently.
      #
      # @return [Boolean] True if successful.
      def teardown(container)
        # NOOP

        true
      end

    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
testlab-0.5.0 lib/testlab/provisioners/shell.rb
testlab-0.4.16 lib/testlab/provisioners/shell.rb
testlab-0.4.15 lib/testlab/provisioners/shell.rb
testlab-0.4.14 lib/testlab/provisioners/shell.rb
testlab-0.4.13 lib/testlab/provisioners/shell.rb
testlab-0.4.12 lib/testlab/provisioners/shell.rb
testlab-0.4.11 lib/testlab/provisioners/shell.rb
testlab-0.4.10 lib/testlab/provisioners/shell.rb
testlab-0.4.9 lib/testlab/provisioners/shell.rb
testlab-0.4.8 lib/testlab/provisioners/shell.rb
testlab-0.4.7 lib/testlab/provisioners/shell.rb
testlab-0.4.6 lib/testlab/provisioners/shell.rb
testlab-0.4.5 lib/testlab/provisioners/shell.rb
testlab-0.4.4 lib/testlab/provisioners/shell.rb
testlab-0.4.3 lib/testlab/provisioners/shell.rb
testlab-0.4.2 lib/testlab/provisioners/shell.rb
testlab-0.4.1 lib/testlab/provisioners/shell.rb
testlab-0.4.0 lib/testlab/provisioners/shell.rb