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