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

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