Class: ChefMetal::Transport
- Inherits:
-
Object
- Object
- ChefMetal::Transport
- Defined in:
- lib/chef_metal/transport.rb,
lib/chef_metal/transport/ssh.rb,
lib/chef_metal/transport/winrm.rb
Direct Known Subclasses
Defined Under Namespace
Instance Method Summary collapse
- #available? ⇒ Boolean
- #disconnect ⇒ Object
- #download_file(path, local_path) ⇒ Object
- #execute(command) ⇒ Object
-
#forward_remote_port_to_local(remote_port, local_port) ⇒ Object
Forward requests to a port on the guest to a server on the host.
- #read_file(path) ⇒ Object
- #upload_file(local_path, path) ⇒ Object
- #write_file(path, content) ⇒ Object
Instance Method Details
#available? ⇒ Boolean
32 33 34 |
# File 'lib/chef_metal/transport.rb', line 32 def available? raise "available? not overridden on #{self.class}" end |
#disconnect ⇒ Object
28 29 30 |
# File 'lib/chef_metal/transport.rb', line 28 def disconnect raise "disconnect not overridden on #{self.class}" end |
#download_file(path, local_path) ⇒ Object
15 16 17 |
# File 'lib/chef_metal/transport.rb', line 15 def download_file(path, local_path) IO.write(local_path, read_file(path)) end |
#execute(command) ⇒ Object
3 4 5 |
# File 'lib/chef_metal/transport.rb', line 3 def execute(command) raise "execute not overridden on #{self.class}" end |
#forward_remote_port_to_local(remote_port, local_port) ⇒ Object
Forward requests to a port on the guest to a server on the host
24 25 26 |
# File 'lib/chef_metal/transport.rb', line 24 def forward_remote_port_to_local(remote_port, local_port) raise "forward_remote_port_to_local not overridden on #{self.class}" end |
#read_file(path) ⇒ Object
7 8 9 |
# File 'lib/chef_metal/transport.rb', line 7 def read_file(path) raise "read_file not overridden on #{self.class}" end |
#upload_file(local_path, path) ⇒ Object
19 20 21 |
# File 'lib/chef_metal/transport.rb', line 19 def upload_file(local_path, path) write_file(path, IO.read(local_path)) end |
#write_file(path, content) ⇒ Object
11 12 13 |
# File 'lib/chef_metal/transport.rb', line 11 def write_file(path, content) raise "write_file not overridden on #{self.class}" end |