Sha256: 3cee93a2937dbbd4f1f4a6b85059126dba80db940aaa9383716cc9f3d15a0bc1

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

class TestLab
  class Network

    module Lifecycle

      # Network Setup
      def setup
        @ui.logger.debug { "Network Setup: #{self.id} " }

        please_wait(:ui => @ui, :message => format_object_action(self, 'Setup', :green)) do

          self.provisioners.each do |provisioner|
            @ui.logger.info { ">>>>> NETWORK PROVISIONER SETUP: #{provisioner} <<<<<" }
            p = provisioner.new(self.config, @ui)
            p.respond_to?(:on_network_setup) and p.on_network_setup(self)
          end

        end

        true
      end

      # Network Teardown
      def teardown
        @ui.logger.debug { "Network Teardown: #{self.id} " }

        please_wait(:ui => @ui, :message => format_object_action(self, 'Teardown', :red)) do

          self.provisioners.each do |provisioner|
            @ui.logger.info { ">>>>> NETWORK PROVISIONER TEARDOWN: #{provisioner} <<<<<" }
            p = provisioner.new(self.config, @ui)
            p.respond_to?(:on_network_teardown) and p.on_network_teardown(self)
          end

        end

        true
      end

      # Build the network
      def build
        self.create
        self.up
        self.setup

        true
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
testlab-0.6.11 lib/testlab/network/lifecycle.rb
testlab-0.6.10 lib/testlab/network/lifecycle.rb
testlab-0.6.9 lib/testlab/network/lifecycle.rb