Exemplo n.º 1
0
 def __init__(self, conduit):
     """
     :param conduit: The importer conduit.
     :type  conduit: pulp.server.conduits.repo_sync.RepoSyncConduit
         """
     self.conduit = conduit
     ProgressReport.__init__(self)
Exemplo n.º 2
0
 def __init__(self, conduit):
     """
     :param conduit: A handler conduit.
     :type conduit: pulp.agent.lib.conduit.Conduit
     """
     self.conduit = conduit
     ProgressReport.__init__(self)
Exemplo n.º 3
0
 def _updated(self):
     """
     Notification that the report has been updated.
     Reported using the conduit.
     """
     ProgressReport._updated(self)
     self.conduit.update_progress(self.dict())
Exemplo n.º 4
0
 def _report_progress(self, progress, task, last_hash):
     """
     Update the progress report only if the progress in the task has changed.
     :param progress: A progress reporting object.
     :type pulp_citrus.progress.ProgressReport
     :param task: A task
     :type task: Task
     :param last_hash: The hash of the last reported progress.
     :type last_hash: int
     :return The new hash.
     :rtype: int
     """
     _hash = hash(repr(task.progress))
     if _hash != last_hash:
         if task.progress:
             reported = task.progress.values()[0]
             report = ProgressReport()
             report.steps = reported['steps']
             report.action = reported['action']
             progress.set_nested_report(report)
     return _hash
Exemplo n.º 5
0
 def _updated(self):
     """
     Send progress report using the conduit when the report is updated.
     """
     ProgressReport._updated(self)
     self.conduit.set_progress(self.dict())