Sha256: 6c50539fdf90e59c137b730dd14db318ef410b04c5d220f3d18f8c3626ad077d

Contents?: true

Size: 1.46 KB

Versions: 14

Compression:

Stored size: 1.46 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

          do_provisioner_callbacks(self, :create, @ui)
        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

          do_provisioner_callbacks(self, :destroy, @ui)
        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

          do_provisioner_callbacks(self, :up, @ui)
        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

          do_provisioner_callbacks(self, :down, @ui)
        end

        true
      end

    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
testlab-1.4.3 lib/testlab/node/actions.rb
testlab-1.4.2 lib/testlab/node/actions.rb
testlab-1.4.1 lib/testlab/node/actions.rb
testlab-1.4.0 lib/testlab/node/actions.rb
testlab-1.3.2 lib/testlab/node/actions.rb
testlab-1.3.1 lib/testlab/node/actions.rb
testlab-1.3.0 lib/testlab/node/actions.rb
testlab-1.2.3 lib/testlab/node/actions.rb
testlab-1.2.2 lib/testlab/node/actions.rb
testlab-1.2.1 lib/testlab/node/actions.rb
testlab-1.2.0 lib/testlab/node/actions.rb
testlab-1.1.0 lib/testlab/node/actions.rb
testlab-1.0.1 lib/testlab/node/actions.rb
testlab-1.0.0 lib/testlab/node/actions.rb