'Write out a line of data to the appropriate stream. Status
lines sent by autotest will be prepended with
"AUTOTEST_STATUS", and all other lines are ssh error
messages.'

def _process_line(self, line):

    status_match = self.status_parser.search(line)
    test_complete_match = self.test_complete_parser.search(line)
    fetch_package_match = self.fetch_package_parser.search(line)
    if status_match:
        (tag, line) = status_match.groups()
        self._process_info_line(line)
        self._process_quoted_line(tag, line)
    elif test_complete_match:
        self._process_logs()
        (fifo_path,) = test_complete_match.groups()
        try:
            self.log_collector.collect_client_job_results()
            self.host.run(('echo    A    >    %s' % fifo_path))
        except Exception:
            msg = 'Post-test    log    collection    failed,    continuing    anyway'
            logging.exception(msg)
    elif fetch_package_match:
        (pkg_name, dest_path, fifo_path) = fetch_package_match.groups()
        serve_packages = settings.get_value('PACKAGES', 'serve_packages_from_autoserv', type=bool)
        if (serve_packages and pkg_name.endswith('.tar.bz2')):
            try:
                self._send_tarball(pkg_name, dest_path)
            except Exception:
                msg = 'Package    tarball    creation    failed,    continuing    anyway'
                logging.exception(msg)
        try:
            self.host.run(('echo    B    >    %s' % fifo_path))
        except Exception:
            msg = 'Package    tarball    installation    failed,    continuing    anyway'
            logging.exception(msg)
    else:
        logging.info(line)
