Blob Blame History Raw
From c805cd23b8bd73986f2546a711edd42150d855ba Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Fri, 22 May 2020 12:05:00 +0200
Subject: [PATCH] [rabbitmq] emulate TTY via timeout foreground

"docker exec -t" might hang without a terminal. Let emulate TTY via
timeout --foreground instead.

Resolves: #2083

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
 sos/plugins/rabbitmq.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py
index 9ebf6c0..8d9a16f 100644
--- a/sos/plugins/rabbitmq.py
+++ b/sos/plugins/rabbitmq.py
@@ -38,8 +38,8 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
             for container in container_names:
                 self.add_cmd_output('docker logs {0}'.format(container))
                 self.add_cmd_output(
-                    'docker exec -t {0} rabbitmqctl report'
-                    .format(container)
+                    'docker exec {0} rabbitmqctl report'
+                    .format(container), foreground=True
                 )
         else:
             self.add_cmd_output("rabbitmqctl report")
-- 
1.8.3.1