DNF 3: progress callback constants moved to dnf.transaction

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-06-26 14:02:59 -07:00 committed by Brian C. Lane
parent f38f5cc168
commit 4a3f9e12aa

View File

@ -23,6 +23,7 @@
import logging import logging
logger = logging.getLogger("pylorax.dnfhelper") logger = logging.getLogger("pylorax.dnfhelper")
import dnf import dnf
import dnf.transaction
import collections import collections
import time import time
import pylorax.output as output import pylorax.output as output
@ -93,7 +94,7 @@ class LoraxRpmCallback(dnf.callback.TransactionProgress):
self._last_ts = None self._last_ts = None
def progress(self, package, action, ti_done, ti_total, ts_done, ts_total): def progress(self, package, action, ti_done, ti_total, ts_done, ts_total):
if action == self.PKG_INSTALL: if action == dnf.transaction.PKG_INSTALL:
# do not report same package twice # do not report same package twice
if self._last_ts == ts_done: if self._last_ts == ts_done:
return return
@ -101,7 +102,7 @@ class LoraxRpmCallback(dnf.callback.TransactionProgress):
msg = '(%d/%d) %s' % (ts_done, ts_total, package) msg = '(%d/%d) %s' % (ts_done, ts_total, package)
logger.info(msg) logger.info(msg)
elif action == self.TRANS_POST: elif action == dnf.transaction.TRANS_POST:
msg = "Performing post-installation setup tasks" msg = "Performing post-installation setup tasks"
logger.info(msg) logger.info(msg)