Blame SOURCES/sos-bz1238349-openstack_trove-plugin.patch

c81b6a
From 85d6ea5cdd32cf1b90a10ff0d50a14dcf24902f8 Mon Sep 17 00:00:00 2001
c81b6a
From: Lee Yarwood <lyarwood@redhat.com>
c81b6a
Date: Tue, 7 Apr 2015 18:26:42 +0100
c81b6a
Subject: [PATCH] [openstack] New Openstack Trove (DBaaS) plugin.
c81b6a
c81b6a
https://wiki.openstack.org/wiki/Trove
c81b6a
c81b6a
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
c81b6a
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
c81b6a
---
c81b6a
 sos/plugins/openstack_trove.py | 74 ++++++++++++++++++++++++++++++++++++++++++
c81b6a
 1 file changed, 74 insertions(+)
c81b6a
 create mode 100644 sos/plugins/openstack_trove.py
c81b6a
c81b6a
diff --git a/sos/plugins/openstack_trove.py b/sos/plugins/openstack_trove.py
c81b6a
new file mode 100644
c81b6a
index 0000000..7c8b661
c81b6a
--- /dev/null
c81b6a
+++ b/sos/plugins/openstack_trove.py
c81b6a
@@ -0,0 +1,74 @@
c81b6a
+# Copyright (C) 2015 Red Hat, Inc., Lee Yarwood <lyarwood@redhat.com>
c81b6a
+
c81b6a
+# This program is free software; you can redistribute it and/or modify
c81b6a
+# it under the terms of the GNU General Public License as published by
c81b6a
+# the Free Software Foundation; either version 2 of the License, or
c81b6a
+# (at your option) any later version.
c81b6a
+
c81b6a
+# This program is distributed in the hope that it will be useful,
c81b6a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
c81b6a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c81b6a
+# GNU General Public License for more details.
c81b6a
+
c81b6a
+# You should have received a copy of the GNU General Public License
c81b6a
+# along with this program; if not, write to the Free Software
c81b6a
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
c81b6a
+
c81b6a
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
c81b6a
+
c81b6a
+
c81b6a
+class OpenStackTrove(Plugin):
c81b6a
+    """OpenStack Trove
c81b6a
+    """
c81b6a
+
c81b6a
+    plugin_name = "openstack_trove"
c81b6a
+    profiles = ('openstack',)
c81b6a
+    option_list = [("log", "gathers openstack trove logs", "slow", True)]
c81b6a
+
c81b6a
+    def setup(self):
c81b6a
+        self.add_copy_spec('/etc/trove/')
c81b6a
+
c81b6a
+        if self.get_option('log'):
c81b6a
+            self.add_copy_spec('/var/log/trove')
c81b6a
+
c81b6a
+    def postproc(self):
c81b6a
+
c81b6a
+        protect_keys = [
c81b6a
+            "dns_passkey", "nova_proxy_admin_pass", "rabbit_password",
c81b6a
+            "qpid_password", "connection", "sql_connection", "admin_password"
c81b6a
+        ]
c81b6a
+
c81b6a
+        conf_list = [
c81b6a
+            '/etc/trove/trove.conf',
c81b6a
+            '/etc/trove/trove-conductor.conf',
c81b6a
+            '/etc/trove/trove-guestmanager.conf',
c81b6a
+            '/etc/trove/trove-taskmanager.conf'
c81b6a
+        ]
c81b6a
+
c81b6a
+        regexp = r"((?m)^\s*#*(%s)\s*=\s*)(.*)" % "|".join(protect_keys)
c81b6a
+
c81b6a
+        for conf in conf_list:
c81b6a
+            self.do_file_sub(conf, regexp, r"\1*********")
c81b6a
+
c81b6a
+
c81b6a
+class DebianOpenStackTrove(OpenStackTrove, DebianPlugin, UbuntuPlugin):
c81b6a
+
c81b6a
+    packages = [
c81b6a
+        'python-trove',
c81b6a
+        'trove-common',
c81b6a
+        'trove-api',
c81b6a
+        'trove-taskmanager'
c81b6a
+    ]
c81b6a
+
c81b6a
+    def setup(self):
c81b6a
+        super(DebianOpenStackTrove, self).setup()
c81b6a
+
c81b6a
+
c81b6a
+class RedHatOpenStackTrove(OpenStackTrove, RedHatPlugin):
c81b6a
+
c81b6a
+    packages = ['openstack-trove']
c81b6a
+
c81b6a
+    def setup(self):
c81b6a
+        super(RedHatOpenStackTrove, self).setup()
c81b6a
+
c81b6a
+# vim: et ts=4 sw=4
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a