Class: TestLab::Provider::Local

Inherits:
Object
  • Object
show all
Defined in:
lib/testlab/providers/local.rb

Overview

Local Provider Class

Author:

  • Zachary Patten <zachary AT jovelabs DOT com>

Instance Method Summary collapse

Constructor Details

#initialize(config = {}, ui = nil) ⇒ Local

Returns a new instance of Local.



13
14
15
16
17
18
19
20
21
# File 'lib/testlab/providers/local.rb', line 13

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

Instance Method Details

#alive?Boolean

This is a NO-OP

Returns:

  • (Boolean)


62
63
64
# File 'lib/testlab/providers/local.rb', line 62

def alive?
  true
end

#createObject

This is a NO-OP



24
25
26
# File 'lib/testlab/providers/local.rb', line 24

def create
  true
end

#dead?Boolean

This is a NO-OP

Returns:

  • (Boolean)


67
68
69
# File 'lib/testlab/providers/local.rb', line 67

def dead?
  false
end

#destroyObject

This is a NO-OP



29
30
31
# File 'lib/testlab/providers/local.rb', line 29

def destroy
  true
end

#downObject

This is a NO-OP



39
40
41
# File 'lib/testlab/providers/local.rb', line 39

def down
  true
end

#exists?Boolean

This is a NO-OP

Returns:

  • (Boolean)


57
58
59
# File 'lib/testlab/providers/local.rb', line 57

def exists?
  true
end

#identityObject



79
80
81
# File 'lib/testlab/providers/local.rb', line 79

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

#instance_idObject



71
72
73
# File 'lib/testlab/providers/local.rb', line 71

def instance_id
  TestLab.hostname
end

#ipObject



83
84
85
# File 'lib/testlab/providers/local.rb', line 83

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

#portObject



87
88
89
# File 'lib/testlab/providers/local.rb', line 87

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

#reloadObject

This is a NO-OP



44
45
46
47
48
49
# File 'lib/testlab/providers/local.rb', line 44

def reload
  self.down
  self.up

  true
end

#stateObject

This is a NO-OP



52
53
54
# File 'lib/testlab/providers/local.rb', line 52

def state
  :running
end

#upObject

This is a NO-OP



34
35
36
# File 'lib/testlab/providers/local.rb', line 34

def up
  true
end

#userObject



75
76
77
# File 'lib/testlab/providers/local.rb', line 75

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