Bug 700371 - RFE: support text-only errata
Summary: RFE: support text-only errata
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-04-28 08:58 UTC by Daniel Mach
Modified: 2011-08-16 12:21 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:08:43 UTC
Embargoed:


Attachments (Terms of Use)
reproducer (3.19 KB, patch)
2011-05-02 14:59 UTC, Daniel Mach
no flags Details | Diff

Description Daniel Mach 2011-04-28 08:58:47 UTC
reproducer is basically
test_errata.py - TestErrata.test_repo_erratum
(just comment lines that remove errata from repo)

No updateinfo.xml is ever created.

Running
$ pulp-admin repo metadata --id=...
doesn't help.

Comment 1 Pradeep Kilambi 2011-04-29 14:11:50 UTC
What build are you using? I just tested it on master and it works as expected,


$ sudo pulp-admin repo add_errata --id=testerrata -e RHEA-2010:9999 
No dependencies to process..
Successfully added Errata ['RHEA-2010:9999'] to repo [testerrata].

This call is directly calling the repoapi.add_errata

$ ls -l /var/lib/pulp/repos/testerrata/repodata/
total 32
-rw-r--r--. 1 apache apache  421 Apr 29 09:44 3510dbe512f9622ebb2457be15672abe979dd875b63889abb82ef6aeffbc4568-updateinfo.xml.gz
-rw-r--r--. 1 apache apache  591 Apr 29 09:17 filelists.sqlite.bz2
-rw-r--r--. 1 apache apache  180 Apr 29 09:17 filelists.xml.gz
-rw-r--r--. 1 apache apache  565 Apr 29 09:17 other.sqlite.bz2
-rw-r--r--. 1 apache apache  176 Apr 29 09:17 other.xml.gz
-rw-r--r--. 1 apache apache 1140 Apr 29 09:17 primary.sqlite.bz2
-rw-r--r--. 1 apache apache  189 Apr 29 09:17 primary.xml.gz
-rw-r--r--. 1 apache apache 3078 Apr 29 09:44 repomd.xml


if you're directly using the api,

Use repoapi.add_errata this should do look up packages in the errata add em to the repo, and generate updateinfo.xml

def add_errata(self, repoid, errataids=()):
        """
         Adds a list of errata to this repo
        """
        repo = self._get_existing_repo(repoid)
        for erratumid in errataids:
            self._add_erratum(repo, erratumid)
        self.collection.save(repo, safe=True)
        self._update_errata_packages(repoid, errataids, action='add')
        updateinfo.generate_updateinfo(repo)


But in either case updateinfo.xml is definitely created.

Comment 2 Daniel Mach 2011-04-29 17:21:56 UTC
build: pulp-0.0.172-1

Maybe the problem is that I didn't specify any packages in the erratum.
This use case has to be supported too (sometimes we deliver text-only errata).

CLI ends here when adding text-only erratum to a repo:
if not effected_pkgs:
    system_exit(os.EX_DATAERR)


I'll provide more details on Monday (will use erratum with files this time).

Comment 3 Daniel Mach 2011-05-02 14:59:03 UTC
Created attachment 496279 [details]
reproducer

can you run attached script and run
$ find /tmp/pulp/repos ?

Comment 4 Daniel Mach 2011-05-02 15:23:33 UTC
Text-only errata are skipped due to following code.

file: src/pulp/server/updateinfo.py
function: generate_updateinfo()

code:
         if not e['pkglist']:
             # for unit tests
             continue

Comment 5 Pradeep Kilambi 2011-05-03 18:23:23 UTC
fixed! eec3319fb6c3d54851c2955b7881fb67211ac05b


Reproducer script:
$ sudo python test.py
[u'test_errata_id_1', u'test_errata_id_2']
.
----------------------------------------------------------------------
Ran 1 test in 1.447s

OK
[unit{master}]$ ls -l /tmp/pulp/repos/some-id/
total 8
drwxr-xr-x. 2 root root 4096 May  3 14:18 repodata
-rw-r--r--. 1 root root  520 May  3 14:18 updateinfo.xml
[pkilambi@prad unit{master}]$ ls -l /tmp/pulp/repos/some-id/repodata/
total 32
-rw-r--r--. 1 root root  219 May  3 14:18 1b37295449988d5b8b8efaa1c437ba2f2779b85500d6de5e2764000f1043c010-updateinfo.xml.gz
-rw-r--r--. 1 root root  589 May  3 14:18 filelists.sqlite.bz2
-rw-r--r--. 1 root root  172 May  3 14:18 filelists.xml.gz
-rw-r--r--. 1 root root  567 May  3 14:18 other.sqlite.bz2
-rw-r--r--. 1 root root  168 May  3 14:18 other.xml.gz
-rw-r--r--. 1 root root 1156 May  3 14:18 primary.sqlite.bz2
-rw-r--r--. 1 root root  181 May  3 14:18 primary.xml.gz
-rw-r--r--. 1 root root 3079 May  3 14:18 repomd.xml

Comment 6 Jeff Ortel 2011-05-04 15:41:52 UTC
build: 0.173

Comment 7 Preethi Thomas 2011-05-05 12:57:40 UTC
verified with the script above
[root@preethi unit]# rpm -q pulp
pulp-0.0.173-1.fc14.noarch

[root@preethi unit]# python test.py 
[u'test_errata_id_1', u'test_errata_id_2']
.
----------------------------------------------------------------------
Ran 1 test in 1.299s

OK
[root@preethi unit]# ls -l /tmp/pulp/repos/some-id/
repodata/       updateinfo.xml  
[root@preethi unit]# ls -l /tmp/pulp/repos/some-id/
total 8
drwxr-xr-x. 2 root root 4096 May  5 09:08 repodata
-rw-r--r--. 1 root root  520 May  5 09:08 updateinfo.xml
[root@preethi unit]# ls -l /tmp/pulp/repos/some-id/repodata/
total 32
-rw-r--r--. 1 root root  219 May  5 09:08 1b37295449988d5b8b8efaa1c437ba2f2779b85500d6de5e2764000f1043c010-updateinfo.xml.gz
-rw-r--r--. 1 root root  581 May  5 09:08 filelists.sqlite.bz2
-rw-r--r--. 1 root root  172 May  5 09:08 filelists.xml.gz
-rw-r--r--. 1 root root  570 May  5 09:08 other.sqlite.bz2
-rw-r--r--. 1 root root  168 May  5 09:08 other.xml.gz
-rw-r--r--. 1 root root 1236 May  5 09:08 primary.sqlite.bz2
-rw-r--r--. 1 root root  181 May  5 09:08 primary.xml.gz
-rw-r--r--. 1 root root 3076 May  5 09:08 repomd.xml
[root@preethi unit]#

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

pulp-0.0.223-4.

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