Sha256: aba8a82d2c27e0b7d358724d12459869a6bc3c5d51ea5fabfab2c974fa668bef

Contents?: true

Size: 1.41 KB

Versions: 15

Compression:

Stored size: 1.41 KB

Contents

class TestLab

  class Provider

    # Local Provider Error Class
    class LocalError < ProviderError; end

    # Local Provider Class
    #
    # @author Zachary Patten <zachary AT jovelabs DOT com>
    class Local

      def initialize(config={}, ui=nil)
        @config = (config || Hash.new)
        @ui     = (ui     || TestLab.ui)

        # ensure our local key is there
        @config[:local] ||= Hash.new
      end

      # This is a NO-OP
      def create
        true
      end

      # This is a NO-OP
      def destroy
        true
      end

      # This is a NO-OP
      def up
        true
      end

      # This is a NO-OP
      def down
        true
      end

      # This is a NO-OP
      def reload
        self.down
        self.up

        true
      end

      # This is a NO-OP
      def state
        :running
      end

      # This is a NO-OP
      def exists?
        true
      end

      # This is a NO-OP
      def alive?
        true
      end

      # This is a NO-OP
      def dead?
        false
      end

      def instance_id
        TestLab.hostname
      end

      def user
        (@config[:local][:user] || ENV['USER'])
      end

      def identity
        (@config[:local][:identity] || File.join(ENV['HOME'], ".ssh", "id_rsa"))
      end

      def ip
        (@config[:local][:ip] || "127.0.0.1")
      end

      def port
        (@config[:local][:port] || 22)
      end

    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
testlab-1.10.0 lib/testlab/providers/local.rb
testlab-1.9.2 lib/testlab/providers/local.rb
testlab-1.9.1 lib/testlab/providers/local.rb
testlab-1.9.0 lib/testlab/providers/local.rb
testlab-1.8.5 lib/testlab/providers/local.rb
testlab-1.8.4 lib/testlab/providers/local.rb
testlab-1.8.3 lib/testlab/providers/local.rb
testlab-1.8.2 lib/testlab/providers/local.rb
testlab-1.8.1 lib/testlab/providers/local.rb
testlab-1.8.0 lib/testlab/providers/local.rb
testlab-1.7.1 lib/testlab/providers/local.rb
testlab-1.7.0 lib/testlab/providers/local.rb
testlab-1.6.6 lib/testlab/providers/local.rb
testlab-1.6.5 lib/testlab/providers/local.rb
testlab-1.6.4 lib/testlab/providers/local.rb