Class: ChefMetal::Transport

Inherits:
Object
  • Object
show all
Defined in:
lib/chef_metal/transport.rb,
lib/chef_metal/transport/ssh.rb,
lib/chef_metal/transport/winrm.rb

Direct Known Subclasses

SSH, WinRM

Defined Under Namespace

Classes: SSH, WinRM

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/chef_metal/transport.rb', line 31

def available?
  raise "available? not overridden on #{self.class}"
end

#disconnectObject



27
28
29
# File 'lib/chef_metal/transport.rb', line 27

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, options = {}) ⇒ Object



3
4
5
# File 'lib/chef_metal/transport.rb', line 3

def execute(command, options = {})
  raise "execute not overridden on #{self.class}"
end

#make_url_available_to_remote(local_url) ⇒ Object



23
24
25
# File 'lib/chef_metal/transport.rb', line 23

def make_url_available_to_remote(local_url)
  raise "make_url_available_to_remote 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