Bug 702434 - incorrect errata in updateinfo.xml
Summary: incorrect errata in updateinfo.xml
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: Sprint 23
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 563609 verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-05-05 16:32 UTC by Daniel Mach
Modified: 2011-08-16 12:22 UTC (History)
2 users (show)

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


Attachments (Terms of Use)

Description Daniel Mach 2011-05-05 16:32:14 UTC
Errata associated to a repo and errata in updateinfo.xml do not match.


pulp version: pulp-0.0.172-1.fc14


$ pulp-admin errata list --repoid=rhel-i386-client-5
+------------------------------------------+
 Available Errata in Repo [rhel-i386-client-5]
+------------------------------------------+
RHBA-2011:0454 , RHBA-2011:0430 , RHBA-2011:0287


$ grep '<id>' /var/lib/pulp/repos/rhel-i386-client-5/updateinfo.xml
  <id>RHBA-2011:0287</id>
  <id>RHBA-2011:0287</id>
  <id>RHBA-2011:0287</id>

^^^ always replaces all errata with the last uploaded

Comment 1 Pradeep Kilambi 2011-05-09 13:28:24 UTC
Hmm lemme understand the issue, so you want us to override existing errata in a repo for each upload? or are you saying the upldateinfo.xml is outdated after the addition of new errata? If former, You think that will always be the case? What if I want to add a specific errata to an already existing repo with errata.  Seems weird to me to override existing errata in a repo for each upload. If later, did you try forcing a regenerate?

Comment 2 Pradeep Kilambi 2011-05-09 13:35:35 UTC
also please clearly specify the steps that caused this. Its not clear to me if this is during creation of new errata or during a sync. I just checked a resync and the errata is updated correctly.

Comment 3 Daniel Mach 2011-05-09 13:52:07 UTC
I created 3 errata (via ErrataAPI) one after another and associated them with a repo (RepoAPI).

updateinfo.xml (see the grep results in description) contains one erratum multiple times instead of 3 different errata. That's the problem.

0x RHBA-2011:0454
0x RHBA-2011:0430
3x RHBA-2011:0287 (the last created, probably somehow overrides the previous errata)

Comment 4 Pradeep Kilambi 2011-05-09 13:54:25 UTC
hmm interesting, this might be a regression because this working in previous builds. I'll look into it, will keep you posted.

Comment 5 Pradeep Kilambi 2011-05-09 14:10:13 UTC
fixed! commit 379e1beea9c1f9df08942882dc707b6308724a5b

Here is the patch if you wanna apply it locally until the next build:

--- a/src/pulp/server/updateinfo.py
+++ b/src/pulp/server/updateinfo.py
@@ -114,13 +114,13 @@ def generate_updateinfo(repo):
     @type repo:  repository object
     """
     um = UpdateMetadata()
-    un = UpdateNotice()
     eapi = ErrataApi()
     if not repo['errata']:
         #no errata to process, return
         return
     errataids = list(chain.from_iterable(repo['errata'].values()))
     for eid in errataids:
+        un = UpdateNotice()
         e = eapi.erratum(eid)
 
         _md = {


$ sudo pulp-admin repo add_errata --id=testerrata -e RHEA-2011:7777 
Successfully added Errata ['RHEA-2011:7777'] to repo [testerrata].

$ grep '<id>' /var/lib/pulp/repos/pub/updates/updateinfo.xml 
  <id>RHEA-2010:9999</id>
  <id>RHEA-2010:9999</id>

After patch:

$ sudo pulp-admin repo add_errata --id=testerrata -e RHEA-2011:5555
Successfully added Errata ['RHEA-2011:5555'] to repo [testerrata].

$ grep '<id>' /var/lib/pulp/repos/pub/updates/updateinfo.xml 
  <id>RHEA-2010:9999</id>
  <id>RHEA-2011:5555</id>
  <id>RHEA-2011:7777</id>

Comment 6 Jeff Ortel 2011-05-09 22:25:15 UTC
build 0.174

Comment 7 Preethi Thomas 2011-05-11 18:48:26 UTC
verified
[root@preethi unit]# rpm -q pulp
pulp-0.0.174-1.fc14.noarch


[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]#

Comment 8 Preethi Thomas 2011-08-16 12:10:23 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 9 Preethi Thomas 2011-08-16 12:22:25 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.