aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/docker.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
index 0a023736..0c5c976e 100644
--- a/sos/plugins/docker.py
+++ b/sos/plugins/docker.py
@@ -17,6 +17,7 @@ from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
class Docker(Plugin):
+
"""Docker containers
"""
@@ -24,6 +25,9 @@ class Docker(Plugin):
profiles = ('virt',)
docker_bin = "docker"
+ option_list = [("all", "capture all container logs even the "
+ "terminated ones", 'fast', False)]
+
def setup(self):
self.add_copy_specs([
"/var/lib/docker/repositories-*"
@@ -35,8 +39,11 @@ class Docker(Plugin):
"{0} images".format(self.docker_bin)
])
- result = self.get_command_output("{0} ps".format(
- self.docker_bin))
+ ps_cmd = "{0} ps".format(self.docker_bin)
+ if self.get_option('all'):
+ ps_cmd = "{0} -a".format(ps_cmd)
+
+ result = self.get_command_output(ps_cmd)
if result['status'] == 0:
result['output'] = result['output'].split("\n")
for line in result['output'][1:]: