Class: TestLab::Provider::Local

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

Overview

Local Provider Class

Author:

  • Zachary Patten

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

#create ⇒ Object

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

#destroy ⇒ Object

This is a NO-OP



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

def destroy
  true
end

#down ⇒ Object

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

#identity ⇒ Object



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_id ⇒ Object



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

def instance_id
  TestLab.hostname
end

#ip ⇒ Object



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

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

#port ⇒ Object



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

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

#reload ⇒ Object

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

#state ⇒ Object

This is a NO-OP



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

def state
  :running
end

#up ⇒ Object

This is a NO-OP



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

def up
  true
end

#user ⇒ Object



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

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