aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Jaggars <jhjaggars@gmail.com>2012-01-10 16:38:53 -0600
committerJesse Jaggars <jhjaggars@gmail.com>2012-01-10 16:38:53 -0600
commitd3af119863bd525e085495d01d329dd4384275cd (patch)
treeeb9f1fe568598479e1c8c13efbb00319d713f349
parent68c4d5d38ed39241b8414442a36a570324ba3531 (diff)
downloadsos-d3af119863bd525e085495d01d329dd4384275cd.tar.gz
adding a tree of all zipped deployments
-rw-r--r--sos/plugins/as7.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/sos/plugins/as7.py b/sos/plugins/as7.py
index d5abea22..5c7a7b3a 100644
--- a/sos/plugins/as7.py
+++ b/sos/plugins/as7.py
@@ -2,6 +2,7 @@ import os
import re
import zipfile
import urllib2
+import tempfile
try:
import json
@@ -282,6 +283,23 @@ class AS7(Plugin, IndependentPlugin):
self.getOption("logsize"),
sub=(self.__jbossHome, 'JBOSSHOME'))
+ for deployment in find("*", os.path.join(path, "deployments")):
+ self._get_tree_from_deployment(deployment)
+
+
+ def _get_tree_from_deployment(self, path):
+ tmp_dir = tempfile.mkdtemp()
+ try:
+ zf = zipfile.ZipFile(path)
+ zf.extractall(path=tmp_dir)
+ zf.close()
+ tree = DirTree(tmp_dir).as_string()
+ self.addStringAsFile(tree, "%s.tree.txt" % os.path.basename(path))
+ except zipfile.BadZipfile:
+ pass
+ os.rmdir(tmp_dir)
+
+
def setup(self):
## We need to know where JBoss is installed and if we can't find it we