def buildTransaction(self): """Build transaction. returns False if empty. """ try: with self._disableOutput: ret = False self._sink.verbose("Building transaction") rc, msg = self._yb.buildTransaction() if rc == 0: self._sink.verbose("Empty transaction") elif rc == 2: ret = True self._sink.verbose("Transaction built") else: raise YumBaseError(msg) return ret except Exception as e: self._sink.error(e) raise