Description of problem: Errata can be deleted without any warning even when they are part of a repo Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create an errata 2. Add errata to a repo 3. Delete the errata (Or sync a repo with errata and delete an erratum in that repo) Actual results: [root@preethi unit]# pulp-admin repo add_errata --id=new-errata-repo -e RHBA-2011-1111 Successfully added Errata ['RHBA-2011-1111'] to repo [new-errata-repo]. [root@preethi unit]# grep '<id>' /var/lib/pulp/repos/new-errata-repo/updateinfo.xml <id>RHBA-2011-1111</id> [root@preethi unit]# [root@preethi unit]# pulp-admin repo add_errata --id=new-errata-repo -e RHBA-2011-1112 Successfully added Errata ['RHBA-2011-1112'] to repo [new-errata-repo]. [root@preethi unit]# grep '<id>' /var/lib/pulp/repos/new-errata-repo/updateinfo.xml <id>RHBA-2011-1111</id> <id>RHBA-2011-1112</id> [root@preethi unit]# pulp-admin repo add_errata --id=new-errata-repo -e RHBA-2011-1113 Successfully added Errata ['RHBA-2011-1113'] to repo [new-errata-repo]. [root@preethi unit]# grep '<id>' /var/lib/pulp/repos/new-errata-repo/updateinfo.xml <id>RHBA-2011-1111</id> <id>RHBA-2011-1112</id> <id>RHBA-2011-1113</id> [root@preethi unit]# rpm -q pul[ package pul[ is not installed [root@preethi unit]# rpm -q pulp pulp-0.0.174-1.fc14.noarch [root@preethi unit]# pulp-admin errata delete --id=RHBA-2011-1111 Successfully deleted Erratum with id [RHBA-2011-1111] [root@preethi unit]# grep '<id>' /var/lib/pulp/repos/new-errata-repo/updateinfo.xml <id>RHBA-2011-1111</id> <id>RHBA-2011-1112</id> <id>RHBA-2011-1113</id> [root@preethi unit]# [root@preethi unit]# [root@preethi unit]# [root@preethi unit]# pulp-admin errata delete --id=FEDORA-2010-16213 Successfully deleted Erratum with id [FEDORA-2010-16213] Expected results: Additional info:
fixed! commit 6bee1ad6cca3951b2d713d792b6cc75e0ac89bd9 This fix will do the following: * checks if an errata to referenced before performing a delete * pulp-admin repo remove_errata will only unassociate the errata from the repo and make it orphaned. [pkilambi@localhost unit]$ sudo pulp-admin errata delete --id=RHEA-2008:0467 error: operation failed: ErrataHasReferences: errata [RHEA-2008:0467] has references, delete not permitted [pkilambi@localhost unit]$ sudo pulp-admin repo remove_errata --id=test_a -e RHEA-2008:0467 Successfully removed Errata ['RHEA-2008:0467'] from repo [test_a]. [pkilambi@localhost unit]$ sudo pulp-admin errata delete --id=RHEA-2008:0467 Successfully deleted Erratum with id [RHEA-2008:0467]
build: 0.177
[root@pulp-qe ~]# pulp-admin errata create --id=RHBA-2011-1111 --title=RHBA-2011-1111 --version=1 --release=1 --type=bugfix Successfully created an Erratum with id [RHBA-2011-1111] [root@pulp-qe ~]# pulp-admin errata create --id=RHBA-2011-1112 --title=RHBA-2011-1112 --version=1 --release=1 --type=bugfix Successfully created an Erratum with id [RHBA-2011-1112] [root@pulp-qe ~]# pulp-admin repo create --id=foo Successfully created repository [ foo ] [root@pulp-qe ~]# pulp-admin repo add_errata --id=foo -e RHBA-2011-1111 Successfully added Errata ['RHBA-2011-1111'] to repo [foo]. [root@pulp-qe ~]# grep '<id>' /var/lib/pulp/repos/foo/updateinfo.xml <id>RHBA-2011-1111</id> [root@pulp-qe ~]# pulp-admin repo add_errata --id=foo -e RHBA-2011-1112 Successfully added Errata ['RHBA-2011-1112'] to repo [foo]. [root@pulp-qe ~]# grep '<id>' /var/lib/pulp/repos/foo/updateinfo.xml <id>RHBA-2011-1111</id> <id>RHBA-2011-1112</id> [root@pulp-qe ~]# [root@pulp-qe ~]# pulp-admin errata delete --id=RHBA-2011-1112 error: operation failed: ErrataHasReferences: errata [RHBA-2011-1112] has references, delete not permitted [root@pulp-qe ~]# pulp-admin repo remove_errata --id=foo -e RHBA-2011-1112 Successfully removed Errata ['RHBA-2011-1112'] from repo [foo]. [root@pulp-qe ~]# grep '<id>' /var/lib/pulp/repos/foo/updateinfo.xml <id>RHBA-2011-1111</id> [root@pulp-qe ~]# pulp-admin errata delete --id=RHBA-2011-1112 Successfully deleted Erratum with id [RHBA-2011-1112] [root@pulp-qe ~]#
Closing with Community Release 15 pulp-0.0.223-4.