Spacewalk 2.2 EPEL7 issues

1)
Got the issue on Centos 6.6 x86_64 with Spacewalk2.2 when tried to do client Centos 7 with EPEL installation – “/tmp/yum.cache/epel7-centos7-x86_64/comps.xml: not well-formed (invalid token): line 1, column 0”.
This is an XML parsing error. The installer is expecting this file to be in XML format. The file is not in XML format, it is XML that has been LZMA/XZ compressed.
I’ve found solution here and here.

So, the idea is to find, first, where spacewalk store python files that I have to update to support xz:
find / -name ‘reposync.py’ or find / -name ‘fileutils.py’

For me it’s here:
/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/reposync.py
/usr/lib/python2.6/site-packages/spacewalk/common/fileutils.py

Update the files:

common/fileutils.py
@@ -17,6 +17,7 @@
import sys
import bz2
import gzip
+import lzma
import pwd
import grp
import types
@@ -478,6 +479,8 @@ def decompress_open(filename, mode='r'):
file_obj = gzip.open(filename, mode)
elif filename.endswith('.bz2'):
file_obj = bz2.BZ2File(filename, mode)
+ elif filename.endswith('.xz'):
+ file_obj = lzma.LZMAFile(filename, mode)
else:
file_obj = open(filename, mode)
return file_obj

satellite_tools/reposync.py
@@ -248,7 +248,7 @@ def import_groups(self, plug, url):
os.makedirs(absdir)
relativepath = os.path.join(relativedir, basename)
abspath = os.path.join(absdir, basename)
- for suffix in ['.gz', '.bz']:
+ for suffix in ['.gz', '.bz', '.xz']:
if basename.endswith(suffix):
abspath = abspath.rstrip(suffix)
relativepath = relativepath.rstrip(suffix)

2)
rhn-client-tools dependencies:

rhn-client-tools-2.2.6-1.el7.noarch requires python-dmidecode
rhn-client-tools-2.2.6-1.el7.noarch requires python-gudev
rhn-client-tools-2.2.6-1.el7.noarch requires python-hwdata

This was caused by using the CentOS-7-x86_64-DVD-1511.iso iso as a kickstart tree…
Resolution: Prepare the centos7 tree using the CentOS-7-x86_64-Everything-1511.iso media:

mkdir /var/satellite/rhn/kickstart/2/centos-7-x86_64-base
mount -o loop /var/CentOS-7-x86_64-Everything-1511.iso /mnt/
rsync -arv /mnt/ /var/satellite/rhn/kickstart/2/centos-7-x86_64-base/
rm -f /var/satellite/rhn/kickstart/2/centos-7-x86_64-base/Packages/*.rpm

Links:

https://marc.info/?l=spacewalk-list&m=142387145808334&w=3

https://github.com/spacewalkproject/spacewalk/commit/76883065ff72449726adc82d081ae681f2a5bb59

Leave a comment

You must be logged in to post a comment.