def ssh_capture(ip, command)
      retval = ""
      configure_ssh_command(ip, command) do |ch, success|
        return "" unless success

        ch.on_data do |ch, data|
          retval << data
        end

        ch.on_request("exit-status") do |ch, data|
          return retval
        end
      end

      return retval
    end
def ssh_capture(ip, command)
      retval = ""
      configure_ssh_command(ip, command) do |ch, success|
        return "" unless success

        ch.on_data do |ch, data|
          retval << data
        end

        ch.on_request("exit-status") do |ch, data|
          return retval
        end
      end

      return retval
    end
run a command, and instead of capturing the exit status, return the data
 captured during the command run.