Bug 703951 - errata delete does not check if the errata is part of the repo and deletes without warnings.
Summary: errata delete does not check if the errata is part of the repo and deletes wi...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 23
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-05-11 18:58 UTC by Preethi Thomas
Modified: 2011-08-16 12:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:09:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2011-05-11 18:58:30 UTC
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:

Comment 1 Pradeep Kilambi 2011-05-12 21:52:39 UTC
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]

Comment 2 Jeff Ortel 2011-05-13 20:50:47 UTC
build: 0.177

Comment 3 dgao 2011-05-24 20:24:44 UTC
[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 ~]#

Comment 4 Preethi Thomas 2011-08-16 12:09:00 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 5 Preethi Thomas 2011-08-16 12:21:44 UTC
Closing with Community Release 15

pulp-0.0.223-4.


Note You need to log in before you can comment on or make changes to this bug.