To speed things up we store the package_count in the db. But evidently the logic is buggy * create a repo and add couple of packages * delete these packages using repo delete_package command with some duplicates * the count goes negative.. lol! Id testrepo2 Name testrepo2 FeedURL None FeedType None Arch noarch Sync Schedule None Packages -3 Files 0 Distributions None Publish True Clones [] Groups None The issue seems to be how remove_package api call is implemented: repo['packages'].pop(p['id'], None) repo['package_count'] = repo['package_count'] - 1 self.objectdb.save(repo, safe=True) so we try to pop and reduce the count by one.. but if this list has some duplicates, instead of checking if pop succeed or not, we reduce the count by 1 always.
Fixed during changes for repo["packages"] from dictionary to list.
Fixed in 0.134.
verified [root@preethi ~]# rpm -q pulp pulp-0.0.135-1.fc14.noarch [root@preethi ~]# pulp-admin repo delete_package --id=upload-repo -p pulp-cds -ppulp-cds ['pulp-cds-0.0.121-1.fc14.noarch', 'pulp-cds-0.0.121-1.fc14.noarch'] [{'name': 'pulp-cds', 'checksum': {'sha256': '834fb545f765603e697ab016755f59afe48c22fb7a2e1411514a165b28ea36d8'}, 'repos': ['upload-repo'], 'filename': 'pulp-cds-0.0.121-1.fc14.noarch.rpm', 'epoch': '0', 'version': '0.0.121', 'release': '1.fc14', '_id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f', 'arch': 'noarch', 'id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f'}, {'name': 'pulp-cds', 'checksum': {'sha256': '834fb545f765603e697ab016755f59afe48c22fb7a2e1411514a165b28ea36d8'}, 'repos': ['upload-repo'], 'filename': 'pulp-cds-0.0.121-1.fc14.noarch.rpm', 'epoch': '0', 'version': '0.0.121', 'release': '1.fc14', '_id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f', 'arch': 'noarch', 'id': '3b24148c-ec5b-4fc4-a850-bd7796b3871f'}] No dependencies to process.. Successfully removed package ['pulp-cds-0.0.121-1.fc14.noarch.rpm'] from repo [upload-repo]. [root@preethi ~]# pulp-admin repo list +------------------------------------------+ List of Available Repositories +------------------------------------------+ Id upload-repo Name upload-repo FeedURL None FeedType None Arch noarch Sync Schedule None Packages 0 Files 0 Distributions None Publish True Clones [] Groups None
Closing with Community Release 15 pulp-0.0.223-4.