[Spacewalk-list] Status of Solaris support

Michael Mraka michael.mraka at redhat.com
Tue Jun 26 12:35:49 UTC 2012


Michael Mraka wrote:
% Pierre Casenove wrote:
% % OK, I think the issue is due to commit 52d29ee4980270fb62f9ffab40e94dc10f4b5e96.
% % extractall is new in python 2.6.
% % On RHEL5 boxes, I only have python 2.4. Package python26 is available,
% % but I'm not sure what side effects it would cause on the rest of my
% % server.
% 
% Oh, I see. Before we fix it the safest workaround which comes on my mind
% is to install rhnpush + heirloom-pkgtools[1] on a different - RHEL6 -
% box and push solaris packages from there. 
% 
% [1] contains pkgtrans -
% http://koji.spacewalkproject.org/koji/packageinfo?packageID=6952

Hi Pierre,

Does attached patch solve you issue?

--
Michael Mráka
Satellite Engineering, Red Hat

-------------- next part --------------
diff --git a/client/tools/rhnpush/archive.py b/client/tools/rhnpush/archive.py
index 873c870..3a1a2e0 100644
--- a/client/tools/rhnpush/archive.py
+++ b/client/tools/rhnpush/archive.py
@@ -243,7 +243,12 @@ class ZipParser(ArchiveParser):
         self._archive_dir = os.path.join(self._temp_dir, self._get_archive_dir())
 
         try:
-            self.zip_file.extractall(self._temp_dir)
+            if hasattr(self.zip_file,'extractall'):
+                self.zip_file.extractall(self._temp_dir)
+            else:
+                # there's no ZipFile.extractall() in python 2.4 (RHEL5)
+                for zipinfo in self.zip_file.namelist():
+                    self.zip_file.extract(zipinfo, self._temp_dir)
         except Exception, e:
             raise InvalidArchiveError("Archive did not expand to %s: %s" %
                                                 (self._archive_dir, str(e)))


More information about the Spacewalk-list mailing list