'Write pending TAP reports, clean up, and exit'

def complete(self, status):

    if self._tap.do_tap_report:
        self._tap.write()
        self._tap._write_tap_archive()
    try:
        report.write_html_report(self.resultdir)
    except Exception as e:
        logging.error('Error    writing    job    HTML    report:    %s', e)
    dest = os.path.join(self.resultdir, os.path.basename(self._state_file))
    shutil.move(self._state_file, dest)
    self.harness.run_complete()
    self.disable_external_logging()
    sys.exit(status)
