Module: RemoteKVM::Helpers

Included in:
RemotekvmCreate, RemotekvmDelete, RemotekvmInfo, RemotekvmList, RemotekvmModify
Defined in:
lib/knife-remotekvm/helpers.rb

Instance Method Summary collapse

Instance Method Details

#knife_ssh(addr, command, args = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/knife-remotekvm/helpers.rb', line 3

def knife_ssh(addr, command, args={})
  cmd = "ssh -o StrictHostKeyChecking=no #{"{config[:lxc_ssh_user]}@" if config[:kvm_ssh_user]}#{addr} #{command}"
  so = Mixlib::ShellOut.new(cmd,
    :logger => Chef::Log.logger,
    :live_stream => $stdout
  ).run_command
  so.error!
  so
end