示例#1
0
 def _synchronize_repository(self, request, repo_id):
     """
     Run synchronization on a repository by ID.
     :param request: A synchronization request.
     :type request: SyncRequest
     :param repo_id: A repository ID.
     :type repo_id: str
     """
     progress = request.progress.find_report(repo_id)
     skip = request.options.get(constants.SKIP_CONTENT_UPDATE_KEYWORD,
                                False)
     if skip:
         progress.finished()
         return
     repo = model.Repository(repo_id)
     importer_report = repo.run_synchronization(progress, request.cancelled,
                                                request.options)
     if request.cancelled():
         request.summary[repo_id].action = RepositoryReport.CANCELLED
         return
     progress.finished()
     details = importer_report['details']
     for _dict in details['errors']:
         ne = NodeError(None)
         ne.load(_dict)
         request.summary.errors.append(ne)
     _report = request.summary[repo_id]
     _report.units.added = importer_report['added_count']
     _report.units.updated = importer_report['updated_count']
     _report.units.removed = importer_report['removed_count']
     _report.sources = details['sources']
示例#2
0
 def _synchronize_repository(self, request, repo_id):
     """
     Run synchronization on a repository by ID.
     :param request: A synchronization request.
     :type request: SyncRequest
     :param repo_id: A repository ID.
     :type repo_id: str
     """
     progress = request.progress.find_report(repo_id)
     skip = request.options.get(constants.SKIP_CONTENT_UPDATE_KEYWORD, False)
     if skip:
         progress.finished()
         return
     repo = Repository(repo_id)
     importer_report = repo.run_synchronization(progress, request.cancelled, request.options)
     if request.cancelled():
         request.summary[repo_id].action = RepositoryReport.CANCELLED
         return
     progress.finished()
     details = importer_report['details']
     for _dict in details['errors']:
         ne = NodeError(None)
         ne.load(_dict)
         request.summary.errors.append(ne)
     _report = request.summary[repo_id]
     _report.units.added = importer_report['added_count']
     _report.units.updated = importer_report['updated_count']
     _report.units.removed = importer_report['removed_count']
示例#3
0
文件: strategies.py 项目: kbotc/pulp
 def _synchronize_repository(self, request, repo_id):
     """
     Run synchronization on a repository by ID.
     :param request: A synchronization request.
     :type request: SyncRequest
     :param repo_id: A repository ID.
     :type repo_id: str
     """
     repo = RepositoryOnChild(repo_id)
     progress = request.progress.find_report(repo_id)
     importer_report = repo.run_synchronization(progress, request.cancelled)
     if request.cancelled():
         request.summary[repo_id].action = RepositoryReport.CANCELLED
         return
     progress.finished()
     details = importer_report['details']
     for _dict in details['errors']:
         ne = NodeError(None)
         ne.load(_dict)
         request.summary.errors.append(ne)
     _report = request.summary[repo_id]
     _report.units.added = importer_report['added_count']
     _report.units.updated = importer_report['updated_count']
     _report.units.removed = importer_report['removed_count']
示例#4
0
 def _synchronize_repository(self, request, repo_id):
     """
     Run synchronization on a repository by ID.
     :param request: A synchronization request.
     :type request: SyncRequest
     :param repo_id: A repository ID.
     :type repo_id: str
     """
     repo = RepositoryOnChild(repo_id)
     progress = request.progress.find_report(repo_id)
     importer_report = repo.run_synchronization(progress, request.cancelled)
     if request.cancelled():
         request.summary[repo_id].action = RepositoryReport.CANCELLED
         return
     progress.finished()
     details = importer_report['details']
     for _dict in details['errors']:
         ne = NodeError(None)
         ne.load(_dict)
         request.summary.errors.append(ne)
     _report = request.summary[repo_id]
     _report.units.added = importer_report['added_count']
     _report.units.updated = importer_report['updated_count']
     _report.units.removed = importer_report['removed_count']