Class: Skewer::ErsatzNode
- Inherits:
-
Object
- Object
- Skewer::ErsatzNode
- Defined in:
- lib/ersatz/ersatz_node.rb
Overview
fakes a fog node
Instance Attribute Summary collapse
-
#dns_name ⇒ Object
Returns the value of attribute dns_name.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(hostname, user) ⇒ ErsatzNode
constructor
A new instance of ErsatzNode.
- #scp(file, dest) ⇒ Object
- #ssh(command) ⇒ Object
- #wait_for ⇒ Object
Constructor Details
#initialize(hostname, user) ⇒ ErsatzNode
Returns a new instance of ErsatzNode.
8 9 10 11 |
# File 'lib/ersatz/ersatz_node.rb', line 8 def initialize(hostname, user) @dns_name = hostname @username = user end |
Instance Attribute Details
#dns_name ⇒ Object
Returns the value of attribute dns_name.
6 7 8 |
# File 'lib/ersatz/ersatz_node.rb', line 6 def dns_name @dns_name end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/ersatz/ersatz_node.rb', line 6 def username @username end |
Instance Method Details
#destroy ⇒ Object
25 26 |
# File 'lib/ersatz/ersatz_node.rb', line 25 def destroy end |
#scp(file, dest) ⇒ Object
21 22 23 |
# File 'lib/ersatz/ersatz_node.rb', line 21 def scp(file, dest) `scp #{file} #{@username}@#{@dns_name}:#{dest}` end |
#ssh(command) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/ersatz/ersatz_node.rb', line 13 def ssh(command) full_ssh_command = "ssh -l #{@username} #{@dns_name} '#{command}'" Skewer.logger.debug full_ssh_command stdout = `#{full_ssh_command}` result = ErsatzSSHResult.new(command, stdout, $?.exitstatus) [result] end |
#wait_for ⇒ Object
28 29 |
# File 'lib/ersatz/ersatz_node.rb', line 28 def wait_for end |