module Chef::Knife::LparBase

Public Instance Methods

get_password() click to toggle source

quick and dirty password prompt, because I'm cool like that

# File lib/chef/knife/lpar_base.rb, line 50
def get_password
  print "Enter root password for HMC: "
  STDIN.noecho(&:gets).chomp
end
print_with_output(message, output = nil) click to toggle source

I hate this name but I'm not thinking of anything better right now.

run_remote_command(ssh, command) click to toggle source
# File lib/chef/knife/lpar_base.rb, line 34
def run_remote_command(ssh, command)
  return_val = nil
  ssh.exec! command do |ch, stream, data|
    if stream == :stdout
      return_val = data.chomp
    else
      # some exception is in order I think
      ui.error "Something went wrong:"
      ui.error data.to_s
      exit 1
    end
  end
  return_val
end