Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
On Tue, Apr 12, 2011 at 04:10:09PM +0200, Michael Calmer wrote: > > > > On which OS was this? > > This was SLES11 with python 2.6. I don't know exactly how python import works. > So I do not exactly now what should work and what not :-) On Wed, Apr 13, 2011 at 03:12:15PM +0200, Martin Zehetmayer wrote: > Hi, > > for I am new on this list let me introduce myself: > My name is Martin Zehetmayer, I work for as consultant for a small linux > solution provider in germany, mostly dealing with RHEL systems. > > I am currently testing spacewalk 1.4-RC6 on a RHEL6.0 x86_64 system. > Installing works very fine but when > adding packages to a custom channel I get the following error: [...] > After searching I found a post in this list from Michael Calmer which reports > the same error under SLES. As mentioned above I tested it under RHEL6 and the > same problem appear. It can be solved using three tests as suggested from > Michael. I've only tested this on RHEL 6.1 (to be) and sadly, yum has changed since vanilla RHEL 6.0. I've now added the import from xml.etree and the 1.4-RC repo has the new spacewalk-backend* packages (1.4.38-1). Thanks for bringing this to our attention. -- Jan Pazdziora Principal Software Engineer, Satellite Engineering, Red Hat ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
Am Dienstag, 12. April 2011, 15:52:35 schrieb Jan Pazdziora: > On Tue, Apr 12, 2011 at 03:46:12PM +0200, Michael Calmer wrote: > > > > Hmm, I wrote a little test script with your version and it did not work > > either. > > On which OS was this? This was SLES11 with python 2.6. I don't know exactly how python import works. So I do not exactly now what should work and what not :-) -- MFG Michael Calmer -- Michael Calmer SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg T: +49 (0) 911 74053 0 F: +49 (0) 911 74053575 - e-mail: michael.cal...@suse.com -- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
On Tue, Apr 12, 2011 at 03:46:12PM +0200, Michael Calmer wrote: > > Hmm, I wrote a little test script with your version and it did not work > either. On which OS was this? -- Jan Pazdziora Principal Software Engineer, Satellite Engineering, Red Hat ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
Hi, Am Dienstag, 12. April 2011, 14:23:51 schrieb Jan Pazdziora: > On Tue, Apr 12, 2011 at 12:41:01PM +0200, Michael Calmer wrote: > > Hi, > > > > cElementTree_iterparse in yum.misc is only available in new versions of > > yum. > > Attached you can find a patch which uses the old style, used in older > > versions of yum. > > In the end, I opted for approach with either does > cElementTree_iterparse or cElementTree. Hmm, I wrote a little test script with your version and it did not work either. May it be that "import cElementTree" is only available on very old systems? I fear we need all three tests. Something like this? try: from yum.misc import cElementTree_iterparse as iterparse except ImportError: try: from xml.etree import cElementTree except ImportError: import cElementTree iterparse = cElementTree.iterparse -- MFG Michael Calmer -- Michael Calmer SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg T: +49 (0) 911 74053 0 F: +49 (0) 911 74053575 - e-mail: michael.cal...@suse.com -- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
On Tue, Apr 12, 2011 at 12:41:01PM +0200, Michael Calmer wrote: > Hi, > > cElementTree_iterparse in yum.misc is only available in new versions of yum. > Attached you can find a patch which uses the old style, used in older > versions > of yum. In the end, I opted for approach with either does cElementTree_iterparse or cElementTree. -- Jan Pazdziora Principal Software Engineer, Satellite Engineering, Red Hat ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
Hi, cElementTree_iterparse in yum.misc is only available in new versions of yum. Attached you can find a patch which uses the old style, used in older versions of yum. Don't know if it makes sense to try also the new version with try/execpt. Am Dienstag, 12. April 2011, 11:10:58 schrieb Jan Pazdziora: > On Tue, Apr 12, 2011 at 10:56:47AM +0200, Marcus Moeller wrote: > > Hi all, > > > > beginning with the testing of 1.4-RC I have noticed that > > spacewalk-repo-sync does not seem to work, anymore: > > > > spacewalk-repo-sync -c fedora-13-x86-tools-os -u > > http://spacewalk.redhat.com/yum/1.4-RC-client/Fedora/13/i386/ > > Traceback (most recent call last): > > File "/usr/bin/spacewalk-repo-sync", line 69, in ? > > sys.exit(abs(main() or 0)) > > File "/usr/bin/spacewalk-repo-sync", line 63, in main > > sync.main() > > File "/usr/lib/python2.4/site- packages/spacewalk/satellite_tools/reposync.py", > > line 108, in main > > plugin = self.load_plugin()(url, self.channel_label) > > File "/usr/lib/python2.4/site- packages/spacewalk/satellite_tools/reposync.py", > > line 137, in load_plugin > > mod = __import__('spacewalk.satellite_tools.repo_plugins', > > globals(), locals(), [name]) > > File "/usr/lib/python2.4/site- packages/spacewalk/satellite_tools/repo_plugins/yum_src.py", > > line 22, in ? > > from yum.misc import cElementTree_iterparse as iterparse > > ImportError: cannot import name cElementTree_iterparse > > Michael, > > the updateinfo patch seems to have broken spacewalk-repo-sync > on RHELs (5 and 6). > > Could you please come up with a patch for the issue? > > Thank you, > > -- > Jan Pazdziora > Principal Software Engineer, Satellite Engineering, Red Hat > -- MFG Michael Calmer -- Michael Calmer SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg T: +49 (0) 911 74053 0 F: +49 (0) 911 74053575 - e-mail: michael.cal...@suse.com -- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) From 83a4493c1aa9d0f20cbe2687ca5e32e5d8120c10 Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Tue, 12 Apr 2011 12:37:23 +0200 Subject: [PATCH] fix provide iterparse cElementTree_iterparse is only available in new versions of yum. Import it directly like in older versions of yum. --- backend/satellite_tools/repo_plugins/yum_src.py |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py index 93f5d60..d4d440c 100644 --- a/backend/satellite_tools/repo_plugins/yum_src.py +++ b/backend/satellite_tools/repo_plugins/yum_src.py @@ -19,10 +19,15 @@ import sys import gzip from yum.update_md import UpdateMetadata, UpdateNoticeException, UpdateNotice from yum.yumRepo import YumRepository -from yum.misc import cElementTree_iterparse as iterparse from spacewalk.satellite_tools.reposync import ContentPackage from spacewalk.common import CFG, initCFG +try: +from xml.etree import cElementTree +except ImportError: +import cElementTree +iterparse = cElementTree.iterparse + class YumWarnings: def write(self, s): pass -- 1.7.3.4 ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Spacewalk 1.4-RC post-upgrade report
On Tue, Apr 12, 2011 at 10:56:47AM +0200, Marcus Moeller wrote: > Hi all, > > beginning with the testing of 1.4-RC I have noticed that > spacewalk-repo-sync does not seem to work, anymore: > > spacewalk-repo-sync -c fedora-13-x86-tools-os -u > http://spacewalk.redhat.com/yum/1.4-RC-client/Fedora/13/i386/ > Traceback (most recent call last): > File "/usr/bin/spacewalk-repo-sync", line 69, in ? > sys.exit(abs(main() or 0)) > File "/usr/bin/spacewalk-repo-sync", line 63, in main > sync.main() > File > "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/reposync.py", > line 108, in main > plugin = self.load_plugin()(url, self.channel_label) > File > "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/reposync.py", > line 137, in load_plugin > mod = __import__('spacewalk.satellite_tools.repo_plugins', > globals(), locals(), [name]) > File > "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/repo_plugins/yum_src.py", > line 22, in ? > from yum.misc import cElementTree_iterparse as iterparse > ImportError: cannot import name cElementTree_iterparse Michael, the updateinfo patch seems to have broken spacewalk-repo-sync on RHELs (5 and 6). Could you please come up with a patch for the issue? Thank you, -- Jan Pazdziora Principal Software Engineer, Satellite Engineering, Red Hat ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel