Sha256: 216b6e1454100b35757a21395c4d52f4b22569a88a29d6aec37e0a0aabba0eeb

Contents?: true

Size: 1.53 KB

Versions: 33

Compression:

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

        @ui.stderr.puts("TestLab::Provider::Local is depreciated.  Please use TestLab::Provider::BareMetal instead.")
      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

33 entries across 33 versions & 1 rubygems

Version Path
testlab-1.22.4 lib/testlab/providers/local.rb
testlab-1.22.3 lib/testlab/providers/local.rb
testlab-1.22.2 lib/testlab/providers/local.rb
testlab-1.22.1 lib/testlab/providers/local.rb
testlab-1.22.0 lib/testlab/providers/local.rb
testlab-1.21.1 lib/testlab/providers/local.rb
testlab-1.21.0 lib/testlab/providers/local.rb
testlab-1.20.6 lib/testlab/providers/local.rb
testlab-1.20.5 lib/testlab/providers/local.rb
testlab-1.20.4 lib/testlab/providers/local.rb
testlab-1.20.3 lib/testlab/providers/local.rb
testlab-1.20.2 lib/testlab/providers/local.rb
testlab-1.20.1 lib/testlab/providers/local.rb
testlab-1.20.0 lib/testlab/providers/local.rb
testlab-1.19.0 lib/testlab/providers/local.rb
testlab-1.18.1 lib/testlab/providers/local.rb
testlab-1.18.0 lib/testlab/providers/local.rb
testlab-1.17.0 lib/testlab/providers/local.rb
testlab-1.16.1 lib/testlab/providers/local.rb
testlab-1.16.0 lib/testlab/providers/local.rb