diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2019-12-17 12:34:16 -0500 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-04-07 16:43:35 -0400 |
commit | 3dd3b813d5c81090ba5d0822e9a48161b052fb21 (patch) | |
tree | cc5bc425237f7239213d7aebb9e13551d8bf447b | |
parent | b6e0117660d816e162a9b8a4df1b79b9ca3982c9 (diff) | |
download | sos-3dd3b813d5c81090ba5d0822e9a48161b052fb21.tar.gz |
[rabbitmq] Update to use ContainerRuntime
Updates the `rabbitmq` plugin to use the new ContainerRuntime
abstraction.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/plugins/rabbitmq.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py index 488040ce..42e60e7d 100644 --- a/sos/plugins/rabbitmq.py +++ b/sos/plugins/rabbitmq.py @@ -22,24 +22,19 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): packages = ('rabbitmq-server',) def setup(self): - container_status = self.exec_cmd( - "docker ps -a --format='{{ .Names }}'" - ) - in_container = False container_names = [] - if container_status['status'] == 0: - for line in container_status['output'].splitlines(): - if line.startswith("rabbitmq"): - in_container = True - container_names.append(line) + _containers = self.get_containers() + for _con in _containers: + if _con[1].startswith('rabbitmq'): + in_container = True + container_names.append(_con[1]) if in_container: for container in container_names: - self.add_cmd_output('docker logs {0}'.format(container)) + self.get_container_logs(container) self.add_cmd_output( - 'docker exec -t {0} rabbitmqctl report' - .format(container) + self.fmt_container_cmd(container, 'rabbitmqctl report') ) else: self.add_cmd_output("rabbitmqctl report") |