Blame SOURCES/sos-bz1118152-disable-the-zip-compression-type.patch

e75bc7
From 081e1ce9f9ad7570d057babd81b474fd407149d7 Mon Sep 17 00:00:00 2001
e75bc7
From: "Bryn M. Reeves" <bmr@redhat.com>
e75bc7
Date: Tue, 9 Dec 2014 17:32:45 +0000
e75bc7
Subject: [PATCH] [sosreport] disable the 'zip' compression type
e75bc7
e75bc7
The Zip archive format is little used and has been broken for
e75bc7
some time:
e75bc7
e75bc7
   Unexpected exception setting up archive:
e75bc7
  Traceback (most recent call last):
e75bc7
    File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1092, in prework
e75bc7
      self._set_archive()
e75bc7
    File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 679, in _set_archive
e75bc7
      self.archive = ZipFileArchive(archive_name, self.tmpdir)
e75bc7
  TypeError: __init__() takes exactly 2 arguments (3 given)
e75bc7
  __init__() takes exactly 2 arguments (3 given)
e75bc7
e75bc7
Remove it from the allowed options list for --compression-type.
e75bc7
e75bc7
The supporting Archive classes can be removed in a separate commit.
e75bc7
e75bc7
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
e75bc7
---
e75bc7
 sos/sosreport.py | 6 ++----
e75bc7
 1 file changed, 2 insertions(+), 4 deletions(-)
e75bc7
e75bc7
diff --git a/sos/sosreport.py b/sos/sosreport.py
e75bc7
index 99b5f47..a697380 100644
e75bc7
--- a/sos/sosreport.py
e75bc7
+++ b/sos/sosreport.py
e75bc7
@@ -599,7 +599,7 @@ class SoSOptions(object):
e75bc7
                           dest="report",
e75bc7
                           help="Disable HTML/XML reporting", default=False)
e75bc7
         parser.add_option("-z", "--compression-type", dest="compression_type",
e75bc7
-                          help="compression technology to use [auto, zip, "
e75bc7
+                          help="compression technology to use [auto, "
e75bc7
                                "gzip, bzip2, xz] (default=auto)",
e75bc7
                           default="auto")
e75bc7
 
e75bc7
@@ -675,8 +675,6 @@ class SoSReport(object):
e75bc7
         if self.opts.compression_type == 'auto':
e75bc7
             auto_archive = self.policy.get_preferred_archive()
e75bc7
             self.archive = auto_archive(archive_name, self.tmpdir)
e75bc7
-        elif self.opts.compression_type == 'zip':
e75bc7
-            self.archive = ZipFileArchive(archive_name, self.tmpdir)
e75bc7
         else:
e75bc7
             self.archive = TarFileArchive(archive_name, self.tmpdir)
e75bc7
         self.archive.set_debug(True if self.opts.debug else False)
e75bc7
@@ -1080,7 +1078,7 @@ class SoSReport(object):
e75bc7
         self.policy.pre_work()
e75bc7
         try:
e75bc7
             self.ui_log.info(_(" Setting up archive ..."))
e75bc7
-            compression_methods = ('auto', 'zip', 'bzip2', 'gzip', 'xz')
e75bc7
+            compression_methods = ('auto', 'bzip2', 'gzip', 'xz')
e75bc7
             method = self.opts.compression_type
e75bc7
             if method not in compression_methods:
e75bc7
                 compression_list = ', '.join(compression_methods)
e75bc7
-- 
e75bc7
1.9.3
e75bc7