aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/__init__.py3
-rw-r--r--sos/plugins/as7.py4
-rw-r--r--sos/utilities.py4
-rw-r--r--tests/archive_tests.py6
4 files changed, 15 insertions, 2 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 500f813f..aaf439bd 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -289,7 +289,8 @@ class Plugin(object):
time_passed = time() - start_time
self.proflog.debug("copied: %-75s time: %f" % (srcpath, time_passed))
except Exception, e:
- self.soslog.debug(traceback.format_exc())
+ self.soslog.error("Unable to copy %s to %s" % (srcpath, dest))
+ self.soslog.error(traceback.format_exc())
def addForbiddenPath(self, forbiddenPath):
diff --git a/sos/plugins/as7.py b/sos/plugins/as7.py
index 5f12be78..a4af8243 100644
--- a/sos/plugins/as7.py
+++ b/sos/plugins/as7.py
@@ -126,7 +126,6 @@ class AS7(Plugin, IndependentPlugin, AS7Mixin):
This function will collect files from JBOSS_HOME for analysis. The scope of files to
be collected are determined by options to this SOS plug-in.
"""
-
for dir_ in configDirAry:
path = os.path.join(self.__jbossHome, dir_)
## First add forbidden files
@@ -156,6 +155,9 @@ class AS7(Plugin, IndependentPlugin, AS7Mixin):
for deployment in deployments:
self.__get_listing_from_deployment(deployment, deployment_info)
+ for xml in find("*.xml", os.path.join(self.__jbossHome, 'modules')):
+ self.addCopySpec(xml, sub=(self.__jbossHome, 'JBOSSHOME'))
+
def __get_deployment_info(self, dir_):
"""Gets the deployment name to sha1 mapping for all deployments defined
in configs under dir_"""
diff --git a/sos/utilities.py b/sos/utilities.py
index 2657c68d..ee241589 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -307,6 +307,10 @@ class ZipFileArchive(Archive):
return self.name()
def add_file(self, src, dest=None):
+ src = str(src)
+ if dest:
+ dest = str(dest)
+
if os.path.isdir(src):
# We may not need, this, but if we do I only want to do it
# one time
diff --git a/tests/archive_tests.py b/tests/archive_tests.py
index 8a542f73..7f4d95e1 100644
--- a/tests/archive_tests.py
+++ b/tests/archive_tests.py
@@ -29,6 +29,12 @@ class ZipFileArchiveTest(unittest.TestCase):
self.check_for_file('test/tests/ziptest')
+ def test_add_unicode_file(self):
+ self.zf.add_file(u'tests/')
+ self.zf.close()
+
+ self.check_for_file('test/tests/ziptest')
+
def test_add_dir(self):
self.zf.add_file('tests/')
self.zf.close()