Blame SOURCES/sos-bz1711305-katello-qpid-certificate.patch

d8dc0d
From 166f712eb447f54f0e2c5396ea25f5bc11e3f519 Mon Sep 17 00:00:00 2001
d8dc0d
From: Pavel Moravec <pmoravec@redhat.com>
d8dc0d
Date: Fri, 17 May 2019 15:55:05 +0200
d8dc0d
Subject: [PATCH] [katello] support both locations of qpid SSL certs
d8dc0d
d8dc0d
Newer katello versions deploy certs for qpid to
d8dc0d
/etc/pki/pulp/qpid/client.crt certs instead of
d8dc0d
/etc/pki/katello/qpid_client_striped.crt .
d8dc0d
d8dc0d
Sosreport should use either of the location that exists, to successfully
d8dc0d
run few qpid-stat commands.
d8dc0d
d8dc0d
Resolves: #1680
d8dc0d
d8dc0d
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
d8dc0d
---
d8dc0d
 sos/plugins/katello.py | 8 +++++++-
d8dc0d
 1 file changed, 7 insertions(+), 1 deletion(-)
d8dc0d
d8dc0d
diff --git a/sos/plugins/katello.py b/sos/plugins/katello.py
d8dc0d
index 0794fb4c..1ea52da8 100644
d8dc0d
--- a/sos/plugins/katello.py
d8dc0d
+++ b/sos/plugins/katello.py
d8dc0d
@@ -10,6 +10,7 @@
d8dc0d
 
d8dc0d
 from sos.plugins import Plugin, RedHatPlugin
d8dc0d
 from pipes import quote
d8dc0d
+import os.path
d8dc0d
 
d8dc0d
 
d8dc0d
 class Katello(Plugin, RedHatPlugin):
d8dc0d
@@ -24,7 +25,12 @@ class Katello(Plugin, RedHatPlugin):
d8dc0d
             "/var/log/httpd/katello-reverse-proxy_error_ssl.log*"
d8dc0d
         ])
d8dc0d
 
d8dc0d
-        cert = "/etc/pki/katello/qpid_client_striped.crt"
d8dc0d
+        # certificate file location relies on katello version, it can be either
d8dc0d
+        # /etc/pki/katello/qpid_client_striped.crt (for older versions) or
d8dc0d
+        # /etc/pki/pulp/qpid/client.crt (for newer versions)
d8dc0d
+        cert = "/etc/pki/pulp/qpid/client.crt"
d8dc0d
+        if not os.path.isfile(cert):
d8dc0d
+            cert = "/etc/pki/katello/qpid_client_striped.crt"
d8dc0d
         self.add_cmd_output([
d8dc0d
             "qpid-stat -%s --ssl-certificate=%s -b amqps://localhost:5671" %
d8dc0d
             (opt, cert) for opt in "quc"
d8dc0d
-- 
d8dc0d
2.17.2
d8dc0d