Blob Blame History Raw
diff -up sos-3.0/sos/plugins/__init__.py.orig sos-3.0/sos/plugins/__init__.py
diff -up sos-3.0/sos/policies/__init__.py.orig sos-3.0/sos/policies/__init__.py
--- sos-3.0/sos/policies/__init__.py.orig	2013-11-14 15:24:08.058501213 +0000
+++ sos-3.0/sos/policies/__init__.py	2013-11-14 15:24:37.410610397 +0000
@@ -252,26 +252,32 @@ No changes will be made to system config
         to use"""
         return "md5"
 
-    def display_results(self, final_filename=None):
+    def display_results(self, final_filename=None, build=False):
 
         # make sure a report exists
         if not final_filename:
            return False
 
-        # store checksum into file
-        fp = open(final_filename + "." + get_hash_name(), "w")
-        checksum = self._create_checksum(final_filename)
-        if checksum:
-            fp.write(checksum + "\n")
-        fp.close()
-
         self._print()
-        self._print(_("Your sosreport has been generated and saved in:\n  %s") % final_filename)
+
+        if not build:
+            # store checksum into file
+            fp = open(final_filename + "." + get_hash_name(), "w")
+            checksum = self._create_checksum(final_filename)
+            if checksum:
+                fp.write(checksum + "\n")
+            fp.close()
+
+            self._print(_("Your sosreport has been generated and saved in:\n  %s") % final_filename)
+        else:
+            checksum = None
+            self._print(_("sosreport build tree is located at : %s" % final_filename))
+
         self._print()
         if checksum:
             self._print(_("The checksum is: ") + checksum)
             self._print()
-        self._print(_("Please send this file to your support representative."))
+            self._print(_("Please send this file to your support representative."))
         self._print()
 
     def upload_results(self, final_filename):
diff -up sos-3.0/sos/sosreport.py.orig sos-3.0/sos/sosreport.py
--- sos-3.0/sos/sosreport.py.orig	2013-11-14 15:23:59.718470188 +0000
+++ sos-3.0/sos/sosreport.py	2013-11-14 15:26:54.935121843 +0000
@@ -204,6 +204,7 @@ class SoSOptions(object):
     _usealloptions = False
     _upload = False
     _batch = False
+    _build = False
     _verbosity = 0
     _quiet = False
     _debug = False
@@ -1111,11 +1112,12 @@ class SoSReport(object):
                     raise
 
     def final_work(self):
-
+        # this must come before archive creation to ensure that log
+        # files are closed and cleaned up at exit.
+        self._finish_logging()
         # package up the results for the support organization
         if not self.opts.build:
-            self.ui_log.info(_("Creating compressed archive..."))
-
+            print _("Creating compressed archive...")
             # compression could fail for a number of reasons
             try:
                 final_filename = self.archive.finalize(self.opts.compression_type)
@@ -1125,17 +1127,14 @@ class SoSReport(object):
                 else:
                     return False
 
-            # automated submission will go here
-            if not self.opts.upload:
-                self.policy.display_results(final_filename)
-            else:
-                self.policy.upload_results(final_filename)
-
         else:
-            self.ui_log.info(_("\n  sosreport build tree is located at : %s\n"
-                            % self.archive.get_archive_path()))
+            final_filename = self.archive.get_archive_path()
 
-        self._finish_logging()
+        # automated submission will go here
+        if not self.opts.upload:
+            self.policy.display_results(final_filename, build = self.opts.build)
+        else:
+            self.policy.upload_results(final_filename)
 
         self.tempfile_util.clean()