def commit(self, commands="", confirmed=None, comment=None,
               at_time=None, synchronize=False, req_format='text'):
        if not commands:
            commands = 'annotate system ""'
        clean_cmds = []
        for cmd in clean_lines(commands):
            clean_cmds.append(cmd)
        self.lock()
        self._session.load_configuration(action='set', config=commands)
        results = ""
        if confirmed:
            results = self._session.commit(confirmed=True,
                                           timeout=str(confirmed),
                                           comment=comment,
                                           synchronize=synchronize)
        else:
            results = self._session.commit(comment=comment, at_time=at_time,
                                           synchronize=synchronize)
        self.unlock()
        if results:
            if req_format == 'xml':
                return results
            results = ET.fromstring(results.tostring)
            out = ''
            for i in results.iter():
                if i.tag == 'commit-check-success':
                    out += 'configuration check succeeds\n'
                elif i.tag == 'commit-success':
                    out += 'commit complete\n'
                elif i.tag == 'ok':
                    out += 'commit complete\n'
                elif i.text is not None:
                    if i.text.strip() + '\n' != '\n':
                        out += i.text.strip() + '\n'
                elif i.text is None:
                    if i.tag + '\n' != '\n':
                        out += i.tag + '\n'
            return out
        return False