Sha256: b423d26bcfdc840e4f1e97ba0cafe8646d0f21c7ff48f438956a1f7cc0133a10

Contents?: true

Size: 1.24 KB

Versions: 27

Compression:

Stored size: 1.24 KB

Contents

class TestLab
  class Node

    module Actions

      # Create the node
      def create
        @ui.logger.debug { "Node Create: #{self.id} " }

        (self.state != :not_created) and return false

        please_wait(:ui => @ui, :message => format_object_action(self, 'Create', :green)) do
          @provider.create
        end

        true
      end

      # Destroy the node
      def destroy
        @ui.logger.debug { "Node Destroy: #{self.id} " }

        (self.state == :not_created) and return false

        please_wait(:ui => @ui, :message => format_object_action(self, 'Destroy', :red)) do
          @provider.destroy
        end

        true
      end

      # Start the node
      def up
        @ui.logger.debug { "Node Up: #{self.id} " }

        (self.state == :running) and return false

        please_wait(:ui => @ui, :message => format_object_action(self, 'Up', :green)) do
          @provider.up
        end

        true
      end

      # Stop the node
      def down
        @ui.logger.debug { "Node Down: #{self.id} " }

        (self.state != :running) and return false

        please_wait(:ui => @ui, :message => format_object_action(self, 'Down', :red)) do
          @provider.down
        end

        true
      end

    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
testlab-0.9.1 lib/testlab/node/actions.rb
testlab-0.9.0 lib/testlab/node/actions.rb
testlab-0.8.6 lib/testlab/node/actions.rb
testlab-0.8.5 lib/testlab/node/actions.rb
testlab-0.8.4 lib/testlab/node/actions.rb
testlab-0.8.3 lib/testlab/node/actions.rb
testlab-0.8.2 lib/testlab/node/actions.rb
testlab-0.8.1 lib/testlab/node/actions.rb
testlab-0.8.0 lib/testlab/node/actions.rb
testlab-0.7.6 lib/testlab/node/actions.rb
testlab-0.7.5 lib/testlab/node/actions.rb
testlab-0.7.4 lib/testlab/node/actions.rb
testlab-0.7.3 lib/testlab/node/actions.rb
testlab-0.7.2 lib/testlab/node/actions.rb
testlab-0.7.1 lib/testlab/node/actions.rb
testlab-0.7.0 lib/testlab/node/actions.rb
testlab-0.6.17 lib/testlab/node/actions.rb
testlab-0.6.16 lib/testlab/node/actions.rb
testlab-0.6.15 lib/testlab/node/actions.rb
testlab-0.6.14 lib/testlab/node/actions.rb