Bug 894480

Summary: Remove PyXML Dep from katello-cli
Product: [Fedora] Fedora Reporter: Toshio Ernie Kuratomi <a.badger>
Component: katello-cliAssignee: Miroslav Suchý <msuchy>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: lzap, msuchy
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-14 16:42:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 843176    
Attachments:
Description Flags
Patch to switch katello-cli from PyXML to python-dateutil
none
Patch for spec file to remove PyXML dep and add python-dateutil none

Description Toshio Ernie Kuratomi 2013-01-11 20:43:37 UTC
Description of problem:
I've opened up a Fedora 19 Feature to remove PyXML due to a combination of it being dead upstream for many years and that when it's installed, the python stdlib overwrites its own xml module with PyXML.  This combination leads to errors because PyXML's code is older and contains bugs that have been fixed in the stdlib.

I've taken a look at why katello-cli has a dependency on PyXML and it looks like it is due to one usage of the xml module for parsing dates:

$ grep -ri xml . |grep import
./src/katello/client/core/utils.py:from xml.utils import iso8601

There was a similar issue with the subscription-manager package: https://bugzilla.redhat.com/show_bug.cgi?id=844072

I'll attach a patch that should port katello-cli from using PyXML to using python-dateutil

Comment 1 Toshio Ernie Kuratomi 2013-01-11 20:44:25 UTC
Created attachment 677108 [details]
Patch to switch katello-cli from PyXML to python-dateutil

Comment 2 Toshio Ernie Kuratomi 2013-01-11 20:45:42 UTC
Created attachment 677109 [details]
Patch for spec file to remove PyXML dep and add python-dateutil

Here's the spec file update that goes along with this.  Note that the current version of katello-cli in the rawhide repo seems to fail build for an unrelated reason.

Comment 3 Miroslav Suchý 2013-01-14 08:48:42 UTC
Thanks for patch and reporting.

Sent to upstream:
https://github.com/Katello/katello/pull/1389

I expect that when Katello 1.3 is released (due in February) that this code will get to Fedora 19.

Comment 4 Toshio Ernie Kuratomi 2013-02-28 17:58:19 UTC
Hey, it's the end of February.  Do we have a new target for the release?

Comment 5 Toshio Ernie Kuratomi 2013-03-06 16:35:48 UTC
If we don't have a release date, may I update the fedora Rawhide package with the patch?  This is the last package blocking the remove PyXML Feature: https://fedoraproject.org/wiki/Features/RemovePyXML

I'd like to remove PyXML from rawhide before Alpha so that we have more testing that the removal doesn't break anything.  If I remove it without this package being fixed, katello will be broken.  I don't really want to stop katello from getting testing at alpha when the fix is right here and has been pulled into the upstream tree :-)

Comment 6 Miroslav Suchý 2013-03-07 08:31:52 UTC
The release date is still not set.
OK. I will push new package from katello nightly to rawhide this afternoon.

Comment 7 Toshio Ernie Kuratomi 2013-03-14 15:08:25 UTC
Thanks!  But a repoquery on rawhide shows that katello is still requiring PyXML:

$ repoquery -q --tree-whatrequires PyXML
PyXML-0:0.8.4-29.fc19.x86_64 [cmd line]
 \_  katello-cli-common-0:1.1.10-1.fc19.noarch [1: PyXML = 0.8.4-29.fc19]
 |   \_  katello-cli-0:1.1.10-1.fc19.noarch [1: katello-cli-common = 1.1.10-1.fc19]
 |   |   \_  katello-cli-unit-tests-0:1.1.10-1.fc19.noarch [1: katello-cli = 1.1.10-1.fc19]
 \_  katello-cli-unit-tests-0:1.1.10-1.fc19.noarch [1: PyXML = 0.8.4-29.fc19]

Comment 8 Miroslav Suchý 2013-03-14 16:42:10 UTC
Now is the correct afternoon :)

Sorry.
Should be built now:
http://koji.fedoraproject.org/koji/taskinfo?taskID=5122298
http://koji.fedoraproject.org/koji/taskinfo?taskID=5122309