Class: Kitchen::Transport::Winrm::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 Winrm

TODO need to fix scheme

Parameters:

  • remote (String)

    file path on instance

  • local (String)

    file path on host



105
106
107
108
109
110
111
112
# File 'lib/kitchen/provisioner/chef_zero_nodes.rb', line 105

def download(remote, local)
  FileUtils.mkdir_p(File.dirname(local))
  file_manager ||= WinRM::FS::FileManager.new(service)
  file_manager.download(remote, local)
  logger.debug("Downloaded #{remote} to #{local}")
rescue Kitchen::Transport::WinrmFailed => ex
  raise WinrmFailed, "Winrm download failed (#{ex.message})"
end