Class: Kitchen::Transport::Ssh::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/provisioner/chef_zero_nodes.rb

Instance Method Summary collapse

Instance Method Details

#download(remote, local) ⇒ Object

Download JSON node file from instance to node_path over SCP

Parameters:

  • remote (String)

    file path on instance

  • local (String)

    file path on host



83
84
85
86
87
88
89
# File 'lib/kitchen/provisioner/chef_zero_nodes.rb', line 83

def download(remote, local)
  FileUtils.mkdir_p(File.dirname(local))
  session.scp.download!(remote, local, {})
  logger.debug("Downloaded #{remote} to #{local}")
rescue Net::SSH::Exception => ex
  raise SshFailed, "SCP download failed (#{ex.message})"
end