Example #1
0
 def test_get_available_drpms(self):
     deltarpm = {}
     for k in UNIT_KEY_DRPM:
         deltarpm[k] = "test_drpm"
     available_drpms = drpm.get_available_drpms([deltarpm])
     lookup_key = drpm.form_lookup_drpm_key(deltarpm)
     self.assertEqual(available_drpms[lookup_key], deltarpm)
Example #2
0
    def _setup_drpms(self, repo, sync_conduit, verify_options, skip_content_types):
        # process deltarpms
        drpm_info = {'available_drpms' : {}, 'existing_drpm_units' : {}, 'orphaned_drpm_units' : {}, 'new_drpms' : {}, 'new_drpm_units' : {}, 'missing_drpms' : {}, 'missing_drpm_units' : {}}
        if 'drpm' in skip_content_types:
            _LOG.info("skipping drpm item setup")
            return drpm_info
        start_metadata = time.time()
        drpm_items = self.yumRepoGrinder.getDeltaRPMItems()
        _LOG.info("Delta RPMs to sync %s" % len(drpm_items))
        drpm_info['available_drpms'] =  drpm.get_available_drpms(drpm_items)
        drpm_info['existing_drpm_units'] = drpm.get_existing_drpm_units(sync_conduit)
        drpm_info['orphaned_drpm_units'] = get_orphaned_units(drpm_info['available_drpms'], drpm_info['existing_drpm_units'])
        end_metadata = time.time()
        _LOG.info("%s drpms are available in the source repo %s, calculated in %s seconds" %\
                  (len(drpm_info['available_drpms']), repo.id, (end_metadata-start_metadata)))

        # Determine new and missing items
        drpm_info['new_drpms'], drpm_info['new_drpm_units'] = drpm.get_new_drpms_and_units(drpm_info['available_drpms'], drpm_info['existing_drpm_units'], sync_conduit)
        drpm_info['missing_drpms'], drpm_info['missing_drpm_units'] = get_missing_rpms_and_units(drpm_info['available_drpms'], drpm_info['existing_drpm_units'], verify_options)
        _LOG.info("Repo <%s> %s existing drpm units, %s have been orphaned, %s new drpms, %s missing drpms." %\
                  (repo.id, len(drpm_info['existing_drpm_units']), len(drpm_info['orphaned_drpm_units']), len(drpm_info['new_drpms']), len(drpm_info['missing_drpms'])))

        return drpm_info