Blame SOURCES/sos-bz1148784-openstack-backport-plugins-from-master.patch

a1ee45
From dda4e7261e77e92434294fe671a7310ab4fc79d2 Mon Sep 17 00:00:00 2001
a1ee45
From: "Bryn M. Reeves" <bmr@redhat.com>
a1ee45
Date: Thu, 11 Sep 2014 12:53:51 +0100
a1ee45
Subject: [PATCH] [openstack] backport OpenStack plugins from master
a1ee45
a1ee45
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
a1ee45
---
a1ee45
 sos/plugins/openstack.py            | 207 ------------------------------------
a1ee45
 sos/plugins/openstack_ceilometer.py |  67 ++++++++++++
a1ee45
 sos/plugins/openstack_cinder.py     |  86 +++++++++++++++
a1ee45
 sos/plugins/openstack_glance.py     |  64 +++++++++++
a1ee45
 sos/plugins/openstack_heat.py       |  68 ++++++++++++
a1ee45
 sos/plugins/openstack_horizon.py    |  81 ++++++++++++++
a1ee45
 sos/plugins/openstack_keystone.py   |  79 ++++++++++++++
a1ee45
 sos/plugins/openstack_neutron.py    | 178 +++++++++++++++++++++++++++++++
a1ee45
 sos/plugins/openstack_nova.py       | 152 ++++++++++++++++++++++++++
a1ee45
 sos/plugins/openstack_swift.py      |  62 +++++++++++
a1ee45
 10 files changed, 837 insertions(+), 207 deletions(-)
a1ee45
 delete mode 100644 sos/plugins/openstack.py
a1ee45
 create mode 100644 sos/plugins/openstack_ceilometer.py
a1ee45
 create mode 100644 sos/plugins/openstack_cinder.py
a1ee45
 create mode 100644 sos/plugins/openstack_glance.py
a1ee45
 create mode 100644 sos/plugins/openstack_heat.py
a1ee45
 create mode 100644 sos/plugins/openstack_horizon.py
a1ee45
 create mode 100644 sos/plugins/openstack_keystone.py
a1ee45
 create mode 100644 sos/plugins/openstack_neutron.py
a1ee45
 create mode 100644 sos/plugins/openstack_nova.py
a1ee45
 create mode 100644 sos/plugins/openstack_swift.py
a1ee45
a1ee45
diff --git a/sos/plugins/openstack.py b/sos/plugins/openstack.py
a1ee45
deleted file mode 100644
a1ee45
index 8c52136..0000000
a1ee45
--- a/sos/plugins/openstack.py
a1ee45
+++ /dev/null
a1ee45
@@ -1,207 +0,0 @@
a1ee45
-## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
a1ee45
-## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.com>
a1ee45
-
a1ee45
-### This program is free software; you can redistribute it and/or modify
a1ee45
-## it under the terms of the GNU General Public License as published by
a1ee45
-## the Free Software Foundation; either version 2 of the License, or
a1ee45
-## (at your option) any later version.
a1ee45
-
a1ee45
-## This program is distributed in the hope that it will be useful,
a1ee45
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
-## GNU General Public License for more details.
a1ee45
-
a1ee45
-## You should have received a copy of the GNU General Public License
a1ee45
-## along with this program; if not, write to the Free Software
a1ee45
-## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
-
a1ee45
-import os
a1ee45
-
a1ee45
-from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
-
a1ee45
-
a1ee45
-class OpenStack(Plugin):
a1ee45
-    """openstack related information
a1ee45
-    """
a1ee45
-    plugin_name = "openstack"
a1ee45
-
a1ee45
-    option_list = [("log", "gathers all openstack logs", "slow", False)]
a1ee45
-
a1ee45
-
a1ee45
-class DebianOpenStack(OpenStack, DebianPlugin, UbuntuPlugin):
a1ee45
-    """OpenStack related information for Debian based distributions
a1ee45
-    """
a1ee45
-
a1ee45
-    packages = ('cinder-api',
a1ee45
-                'cinder-backup',
a1ee45
-                'cinder-common',
a1ee45
-                'cinder-scheduler',
a1ee45
-                'cinder-volume',
a1ee45
-                'glance',
a1ee45
-                'glance-api',
a1ee45
-                'glance-client',
a1ee45
-                'glance-common',
a1ee45
-                'glance-registry',
a1ee45
-                'keystone',
a1ee45
-                'melange',
a1ee45
-                'nova-api-ec2',
a1ee45
-                'nova-api-metadata',
a1ee45
-                'nova-api-os-compute',
a1ee45
-                'nova-api-os-volume',
a1ee45
-                'nova-common',
a1ee45
-                'nova-compute',
a1ee45
-                'nova-compute-kvm',
a1ee45
-                'nova-compute-lxc',
a1ee45
-                'nova-compute-qemu',
a1ee45
-                'nova-compute-uml',
a1ee45
-                'nova-compute-xcp',
a1ee45
-                'nova-compute-xen',
a1ee45
-                'nova-xcp-plugins',
a1ee45
-                'nova-consoleauth',
a1ee45
-                'nova-network',
a1ee45
-                'nova-scheduler',
a1ee45
-                'nova-volume',
a1ee45
-                'novnc',
a1ee45
-                'openstack-dashboard',
a1ee45
-                'quantum-common',
a1ee45
-                'quantum-plugin-cisco',
a1ee45
-                'quantum-plugin-linuxbridge-agent',
a1ee45
-                'quantum-plugin-nicira',
a1ee45
-                'quantum-plugin-openvswitch',
a1ee45
-                'quantum-plugin-openvswitch-agent',
a1ee45
-                'quantum-plugin-ryu',
a1ee45
-                'quantum-plugin-ryu-agent',
a1ee45
-                'quantum-server',
a1ee45
-                'swift',
a1ee45
-                'swift-account',
a1ee45
-                'swift-container',
a1ee45
-                'swift-object',
a1ee45
-                'swift-proxy',
a1ee45
-                'swauth',
a1ee45
-                'python-cinder',
a1ee45
-                'python-cinderclient',
a1ee45
-                'python-django-horizon',
a1ee45
-                'python-glance',
a1ee45
-                'python-keystone',
a1ee45
-                'python-keystoneclient',
a1ee45
-                'python-melange',
a1ee45
-                'python-nova',
a1ee45
-                'python-novaclient',
a1ee45
-                'python-novnc',
a1ee45
-                'python-quantum',
a1ee45
-                'python-quantumclient',
a1ee45
-                'python-swift',
a1ee45
-                'python-swauth')
a1ee45
-
a1ee45
-    def setup(self):
a1ee45
-        # Nova
a1ee45
-        if os.path.exists("nova-manage"):
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage config list 2>/dev/null | sort",
a1ee45
-                suggest_filename="nova_config_list")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage service list 2>/dev/null",
a1ee45
-                suggest_filename="nova_service_list")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage db version 2>/dev/null",
a1ee45
-                suggest_filename="nova_db_version")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage fixed list 2>/dev/null",
a1ee45
-                suggest_filename="nova_fixed_ip_list")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage floating list 2>/dev/null",
a1ee45
-                suggest_filename="nova_floating_ip_list")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage flavor list 2>/dev/null",
a1ee45
-                suggest_filename="nova_flavor_list")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage network list 2>/dev/null",
a1ee45
-                suggest_filename="nova_network_list")
a1ee45
-            self.add_cmd_output(
a1ee45
-                "nova-manage vm list 2>/dev/null",
a1ee45
-                suggest_filename="nova_vm_list")
a1ee45
-        self.add_copy_specs(["/etc/nova/",
a1ee45
-                           "/var/log/nova/",
a1ee45
-                           "/etc/default/nova-volume",
a1ee45
-                           "/etc/sudoers.d/nova_sudoers",
a1ee45
-                           "/etc/logrotate.d/nova-*"])
a1ee45
-        # Cinder
a1ee45
-        if os.path.exists("/usr/bin/cinder-manage"):
a1ee45
-            self.addCmdOutput(
a1ee45
-                "/usr/bin/cinder-manage db version",
a1ee45
-                suggest_filename="cinder_db_version")
a1ee45
-        self.addCopySpecs(["/etc/cinder/",
a1ee45
-                           "/var/log/cinder/",
a1ee45
-                           "/etc/logrotate.d/cinder-*"])
a1ee45
-        # Glance
a1ee45
-        if os.path.exists("glance-manage"):
a1ee45
-            self.add_cmd_output(
a1ee45
-                "glance-manage db_version",
a1ee45
-                suggest_filename="glance_db_version")
a1ee45
-        self.add_copy_specs(["/etc/glance/",
a1ee45
-                           "/var/log/glance/",
a1ee45
-                           "/etc/logrotate.d/glance-*"])
a1ee45
-        # Keystone
a1ee45
-        self.add_copy_specs(["/etc/keystone/",
a1ee45
-                           "/var/log/keystone/",
a1ee45
-                           "/etc/logrotate.d/keystone"])
a1ee45
-        # Swift
a1ee45
-        self.add_copy_specs(["/etc/swift/"])
a1ee45
-        # Quantum
a1ee45
-        self.add_copy_specs(["/etc/quantum/",
a1ee45
-                           "/var/log/quantum/"])
a1ee45
-
a1ee45
-
a1ee45
-class RedHatOpenStack(OpenStack, RedHatPlugin):
a1ee45
-    """OpenStack related information for Red Hat distributions
a1ee45
-    """
a1ee45
-
a1ee45
-    packages = ('openstack-nova',
a1ee45
-                'openstack-glance',
a1ee45
-                'openstack-dashboard',
a1ee45
-                'openstack-keystone',
a1ee45
-                'openstack-quantum',
a1ee45
-                'openstack-swift',
a1ee45
-                'openstack-swift-account',
a1ee45
-                'openstack-swift-container',
a1ee45
-                'openstack-swift-object',
a1ee45
-                'openstack-swift-proxy',
a1ee45
-                'swift',
a1ee45
-                'python-nova',
a1ee45
-                'python-glanceclient',
a1ee45
-                'python-keystoneclient',
a1ee45
-                'python-novaclient',
a1ee45
-                'python-openstackclient',
a1ee45
-                'python-quantumclient')
a1ee45
-
a1ee45
-    def setup(self):
a1ee45
-        # If RHEL or Fedora then invoke script for openstack-status
a1ee45
-        if (os.path.isfile('/etc/redhat-release')
a1ee45
-            or os.path.isfile('/etc/fedora-release')):
a1ee45
-            self.add_cmd_output("openstack-status")
a1ee45
-
a1ee45
-        # Nova
a1ee45
-        self.add_copy_specs(["/etc/nova/",
a1ee45
-                           "/var/log/nova/",
a1ee45
-                           "/var/lib/nova/",
a1ee45
-                           "/etc/polkit-1/localauthority/50-local.d/50-nova.pkla",
a1ee45
-                           "/etc/sudoers.d/nova",
a1ee45
-                           "/etc/logrotate.d/openstack-nova"])
a1ee45
-
a1ee45
-        # Glance
a1ee45
-        self.add_copy_specs(["/etc/glance/",
a1ee45
-                           "/var/log/glance/",
a1ee45
-                           "/etc/logrotate.d/openstack-glance"])
a1ee45
-
a1ee45
-        # Keystone
a1ee45
-        self.add_copy_specs(["/etc/keystone/",
a1ee45
-                           "/var/log/keystone/"])
a1ee45
-
a1ee45
-        # Quantum
a1ee45
-        self.add_copy_specs(["/etc/quantum/",
a1ee45
-                           "/var/log/quantum/"])
a1ee45
-
a1ee45
-    def postproc(self):
a1ee45
-        self.do_file_sub('/etc/keystone/keystone.conf',
a1ee45
-                    r"(admin_password\s*=\s*)(.*)",
a1ee45
-                    r"\1******")
a1ee45
diff --git a/sos/plugins/openstack_ceilometer.py b/sos/plugins/openstack_ceilometer.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_ceilometer.py
a1ee45
@@ -0,0 +1,67 @@
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Eoghan Lynn <eglynn@redhat.com>
a1ee45
+# Copyright (C) 2012 Rackspace US, Inc.
a1ee45
+#               2012 Justin Shepherd <jshepher@rackspace.com>
a1ee45
+# Copyright (C) 2009 Red Hat, Inc.
a1ee45
+#               2009 Joey Boggs <jboggs@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackCeilometer(Plugin):
a1ee45
+    """Openstack Ceilometer related information."""
a1ee45
+    plugin_name = "openstack_ceilometer"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack-ceilometer logs", "slow", False)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        # Ceilometer
a1ee45
+        self.add_copy_specs([
a1ee45
+            "/etc/ceilometer/",
a1ee45
+            "/var/log/ceilometer"
a1ee45
+        ])
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackCeilometer(OpenStackCeilometer, DebianPlugin,
a1ee45
+                                UbuntuPlugin):
a1ee45
+    """OpenStackCeilometer related information for Debian based distributions.
a1ee45
+    """
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'ceilometer-api',
a1ee45
+        'ceilometer-agent-central',
a1ee45
+        'ceilometer-agent-compute',
a1ee45
+        'ceilometer-collector',
a1ee45
+        'ceilometer-common',
a1ee45
+        'python-ceilometer',
a1ee45
+        'python-ceilometerclient'
a1ee45
+    )
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackCeilometer(OpenStackCeilometer, RedHatPlugin):
a1ee45
+    """OpenStackCeilometer related information for Red Hat distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'openstack-ceilometer',
a1ee45
+        'openstack-ceilometer-api',
a1ee45
+        'openstack-ceilometer-central',
a1ee45
+        'openstack-ceilometer-collector',
a1ee45
+        'openstack-ceilometer-common',
a1ee45
+        'openstack-ceilometer-compute',
a1ee45
+        'python-ceilometerclient'
a1ee45
+    )
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_cinder.py
a1ee45
@@ -0,0 +1,86 @@
a1ee45
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
a1ee45
+# Copyright (C) 2012 Rackspace US, Inc.,
a1ee45
+#                    Justin Shepherd <jshepher@rackspace.com>
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com>
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackCinder(Plugin):
a1ee45
+    """openstack cinder related information
a1ee45
+    """
a1ee45
+    plugin_name = "openstack_cinder"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack cinder logs", "slow", True),
a1ee45
+                   ("db", "gathers openstack cinder db version", "slow",
a1ee45
+                    False)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        if self.get_option("db"):
a1ee45
+            self.add_cmd_output(
a1ee45
+                "cinder-manage db version",
a1ee45
+                suggest_filename="cinder_db_version")
a1ee45
+
a1ee45
+        self.add_copy_specs(["/etc/cinder/"])
a1ee45
+
a1ee45
+        if self.get_option("log"):
a1ee45
+            self.add_copy_specs(["/var/log/cinder/"])
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackCinder(OpenStackCinder, DebianPlugin, UbuntuPlugin):
a1ee45
+    """OpenStack Cinder related information for Debian based distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    cinder = False
a1ee45
+    packages = (
a1ee45
+        'cinder-api',
a1ee45
+        'cinder-backup',
a1ee45
+        'cinder-common',
a1ee45
+        'cinder-scheduler',
a1ee45
+        'cinder-volume',
a1ee45
+        'python-cinder',
a1ee45
+        'python-cinderclient'
a1ee45
+    )
a1ee45
+
a1ee45
+    def check_enabled(self):
a1ee45
+        self.cinder = self.is_installed("cinder-common")
a1ee45
+        return self.cinder
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(DebianOpenStackCinder, self).setup()
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackCinder(OpenStackCinder, RedHatPlugin):
a1ee45
+    """OpenStack related information for Red Hat distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    cinder = False
a1ee45
+    packages = ('openstack-cinder',
a1ee45
+                'python-cinder',
a1ee45
+                'python-cinderclient')
a1ee45
+
a1ee45
+    def check_enabled(self):
a1ee45
+        self.cinder = self.is_installed("openstack-cinder")
a1ee45
+        return self.cinder
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(RedHatOpenStackCinder, self).setup()
a1ee45
+        self.add_copy_specs(["/etc/sudoers.d/cinder"])
a1ee45
+
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_glance.py
a1ee45
@@ -0,0 +1,64 @@
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com>
a1ee45
+# Copyright (C) 2012 Rackspace US, Inc.,
a1ee45
+#                    Justin Shepherd <jshepher@rackspace.com>
a1ee45
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos import plugins
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackGlance(plugins.Plugin):
a1ee45
+    """OpenstackGlance related information."""
a1ee45
+    plugin_name = "openstack_glance"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack-glance logs", "slow", False)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        # Glance
a1ee45
+        self.add_cmd_output(
a1ee45
+            "glance-manage db_version",
a1ee45
+            suggest_filename="glance_db_version"
a1ee45
+        )
a1ee45
+        self.add_copy_specs([
a1ee45
+            "/etc/glance/",
a1ee45
+            "/var/log/glance/"
a1ee45
+        ])
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackGlance(OpenStackGlance,
a1ee45
+                            plugins.DebianPlugin,
a1ee45
+                            plugins.UbuntuPlugin):
a1ee45
+    """OpenStackGlance related information for Debian based distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'glance',
a1ee45
+        'glance-api',
a1ee45
+        'glance-client',
a1ee45
+        'glance-common',
a1ee45
+        'glance-registry',
a1ee45
+        'python-glance'
a1ee45
+    )
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackGlance(OpenStackGlance, plugins.RedHatPlugin):
a1ee45
+    """OpenStackGlance related information for Red Hat distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'openstack-glance',
a1ee45
+        'python-glanceclient'
a1ee45
+    )
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_heat.py
a1ee45
@@ -0,0 +1,68 @@
a1ee45
+# Copyright (C) 2013 Red Hat, Inc.
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos import plugins
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackHeat(plugins.Plugin):
a1ee45
+    """openstack related information
a1ee45
+    """
a1ee45
+    plugin_name = "openstack_heat"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack-heat logs", "slow", False)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        # Heat
a1ee45
+        self.add_cmd_output(
a1ee45
+            "heat-manage db_version",
a1ee45
+            suggest_filename="heat_db_version"
a1ee45
+        )
a1ee45
+        self.add_copy_specs([
a1ee45
+            "/etc/heat/",
a1ee45
+            "/var/log/heat/"
a1ee45
+        ])
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStack(OpenStackHeat,
a1ee45
+                      plugins.DebianPlugin,
a1ee45
+                      plugins.UbuntuPlugin):
a1ee45
+    """OpenStackHeat related information for Debian based distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'heat-api',
a1ee45
+        'heat-api-cfn',
a1ee45
+        'heat-api-cloudwatch',
a1ee45
+        'heat-common',
a1ee45
+        'heat-engine',
a1ee45
+        'python-heat',
a1ee45
+        'python-heatclient'
a1ee45
+    )
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStack(OpenStackHeat, plugins.RedHatPlugin):
a1ee45
+    """OpenStackHeat related information for Red Hat distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'openstack-heat-api',
a1ee45
+        'openstack-heat-api-cfn',
a1ee45
+        'openstack-heat-api-cloudwatch',
a1ee45
+        'openstack-heat-cli',
a1ee45
+        'openstack-heat-common',
a1ee45
+        'openstack-heat-engine',
a1ee45
+        'python-heatclient'
a1ee45
+    )
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_horizon.py
a1ee45
@@ -0,0 +1,81 @@
a1ee45
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
a1ee45
+# Copyright (C) 2012 Rackspace US, Inc.,
a1ee45
+#                    Justin Shepherd <jshepher@rackspace.com>
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackHorizon(Plugin):
a1ee45
+    """openstack horizon related information
a1ee45
+    """
a1ee45
+
a1ee45
+    plugin_name = "openstack_horizon"
a1ee45
+    option_list = [("log", "gathers openstack horizon logs", "slow", True)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        self.add_copy_spec("/etc/openstack-dashboard/")
a1ee45
+        if self.get_option("log"):
a1ee45
+            self.add_copy_spec("/var/log/horizon/")
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackHorizon(OpenStackHorizon, DebianPlugin):
a1ee45
+    """OpenStack Horizon related information for Debian based distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'python-django-horizon',
a1ee45
+        'openstack-dashboard',
a1ee45
+        'openstack-dashboard-apache'
a1ee45
+    )
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(DebianOpenStackHorizon, self).setup()
a1ee45
+        self.add_copy_spec("/etc/apache2/sites-available/")
a1ee45
+
a1ee45
+
a1ee45
+class UbuntuOpenStackHorizon(OpenStackHorizon, UbuntuPlugin):
a1ee45
+    """OpenStack Horizon related information for Ubuntu based distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'python-django-horizon',
a1ee45
+        'openstack-dashboard',
a1ee45
+        'openstack-dashboard-ubuntu-theme'
a1ee45
+    )
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(UbuntuOpenStackHorizon, self).setup()
a1ee45
+        self.add_copy_spec("/etc/apache2/conf.d/openstack-dashboard.conf")
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackHorizon(OpenStackHorizon, RedHatPlugin):
a1ee45
+    """OpenStack Horizon related information for Red Hat distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'python-django-horizon',
a1ee45
+        'openstack-dashboard'
a1ee45
+    )
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(RedHatOpenStackHorizon, self).setup()
a1ee45
+        self.add_copy_spec("/etc/httpd/conf.d/openstack-dashboard.conf")
a1ee45
+        if self.get_option("log"):
a1ee45
+            self.add_copy_spec("/var/log/httpd/")
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_keystone.py
a1ee45
@@ -0,0 +1,79 @@
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackKeystone(Plugin):
a1ee45
+    """openstack keystone related information
a1ee45
+    """
a1ee45
+    plugin_name = "openstack_keystone"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack keystone logs", "slow", True),
a1ee45
+                   ("nopw", "dont gathers keystone passwords", "slow", True)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        self.add_copy_specs([
a1ee45
+            "/etc/keystone/default_catalog.templates",
a1ee45
+            "/etc/keystone/keystone.conf",
a1ee45
+            "/etc/keystone/logging.conf",
a1ee45
+            "/etc/keystone/policy.json"
a1ee45
+        ])
a1ee45
+
a1ee45
+        if self.get_option("log"):
a1ee45
+            self.add_copy_spec("/var/log/keystone/")
a1ee45
+
a1ee45
+    def postproc(self):
a1ee45
+        self.do_file_sub('/etc/keystone/keystone.conf',
a1ee45
+                         r"(?m)^(admin_password.*=)(.*)",
a1ee45
+                         r"\1 ******")
a1ee45
+        self.do_file_sub('/etc/keystone/keystone.conf',
a1ee45
+                         r"(?m)^(admin_token.*=)(.*)",
a1ee45
+                         r"\1 ******")
a1ee45
+        self.do_file_sub('/etc/keystone/keystone.conf',
a1ee45
+                         r"(?m)^(connection.*=.*mysql://)(.*)(:)(.*)(@)(.*)",
a1ee45
+                         r"\1\2:******@\6")
a1ee45
+        self.do_file_sub('/etc/keystone/keystone.conf',
a1ee45
+                         r"(?m)^(password.*=)(.*)",
a1ee45
+                         r"\1 ******")
a1ee45
+        self.do_file_sub('/etc/keystone/keystone.conf',
a1ee45
+                         r"(?m)^(ca_password.*=)(.*)",
a1ee45
+                         r"\1 ******")
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackKeystone(OpenStackKeystone, DebianPlugin, UbuntuPlugin):
a1ee45
+    """OpenStack Keystone related information for Debian based distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'keystone',
a1ee45
+        'python-keystone',
a1ee45
+        'python-keystoneclient'
a1ee45
+    )
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackKeystone(OpenStackKeystone, RedHatPlugin):
a1ee45
+    """OpenStack Keystone related information for Red Hat distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'openstack-keystone',
a1ee45
+        'python-keystone',
a1ee45
+        'python-django-openstack-auth',
a1ee45
+        'python-keystoneclient'
a1ee45
+    )
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_neutron.py
a1ee45
@@ -0,0 +1,175 @@
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Brent Eagles <beagles@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+import os
a1ee45
+import re
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+# The Networking plugin includes most of what is needed from a snapshot
a1ee45
+# of the networking, so we only need to focus on the parts that are specific
a1ee45
+# to OpenStack Networking. The Process plugin should capture the dnsmasq
a1ee45
+# command line. The libvirt plugin grabs the instance's XML definition which
a1ee45
+# has the interface names for an instance. So what remains is relevant database
a1ee45
+# info...
a1ee45
+
a1ee45
+
a1ee45
+class Neutron(Plugin):
a1ee45
+    """OpenStack Networking (quantum/neutron) related information
a1ee45
+    """
a1ee45
+    plugin_name = "neutron"
a1ee45
+
a1ee45
+    option_list = [("log", "Gathers all Neutron logs", "slow", False),
a1ee45
+                   ("quantum", "Overrides checks for newer Neutron components",
a1ee45
+                    "fast", False)]
a1ee45
+
a1ee45
+    component_name = "neutron"
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        if os.path.exists("/etc/neutron/") and not self.get_option("quantum"):
a1ee45
+            self.component_name = self.plugin_name
a1ee45
+        else:
a1ee45
+            self.component_name = "quantum"
a1ee45
+        self.add_copy_specs([
a1ee45
+            "/etc/%s/" % self.component_name,
a1ee45
+            "/var/log/%s/" % self.component_name
a1ee45
+        ])
a1ee45
+
a1ee45
+        self.netns_dumps()
a1ee45
+
a1ee45
+    def netns_dumps(self):
a1ee45
+        # It would've been beautiful if we could get parts of the networking
a1ee45
+        # plugin to run in different namespaces. There are a couple of options
a1ee45
+        # in the short term: create a local instance and "borrow" some of the
a1ee45
+        # functionality, or simply copy some of the functionality.
a1ee45
+        prefixes = ["qdhcp", "qrouter"]
a1ee45
+        ip_netns_result = self.call_ext_prog("ip netns")
a1ee45
+        if not (ip_netns_result[0] == 0):
a1ee45
+            return
a1ee45
+        nslist = ip_netns_result[1]
a1ee45
+        lease_directories = []
a1ee45
+        if nslist:
a1ee45
+            for nsname in nslist.splitlines():
a1ee45
+                prefix, netid = nsname.split('-', 1)
a1ee45
+                if len(netid) > 0 and prefix in prefixes:
a1ee45
+                    self.ns_gather_data(nsname)
a1ee45
+                    lease_directories.append(
a1ee45
+                        "/var/lib/%s/dhcp/%s/" %
a1ee45
+                        (self.component_name, netid))
a1ee45
+            self.add_copy_specs(lease_directories)
a1ee45
+
a1ee45
+    # TODO: Refactor! Copied from Networking plugin.
a1ee45
+    def get_interface_name(self, ip_addr_out):
a1ee45
+        """Return a dictionary for which key are interface name according to
a1ee45
+        the output of ifconifg-a stored in ifconfig_file.
a1ee45
+        """
a1ee45
+        out = {}
a1ee45
+        for line in ip_addr_out.splitlines():
a1ee45
+            match = re.match('.*link/ether', line)
a1ee45
+            if match:
a1ee45
+                int = match.string.split(':')[1].lstrip()
a1ee45
+                out[int] = True
a1ee45
+        return out
a1ee45
+
a1ee45
+    def ns_gather_data(self, nsname):
a1ee45
+        cmd_prefix = "ip netns exec %s " % nsname
a1ee45
+        self.add_cmd_outputs([
a1ee45
+            cmd_prefix + "iptables-save",
a1ee45
+            cmd_prefix + "ifconfig -a",
a1ee45
+            cmd_prefix + "route -n"
a1ee45
+        ])
a1ee45
+        # borrowed from networking plugin
a1ee45
+        ip_addr_result = self.call_ext_prog(cmd_prefix + "ip -o link")
a1ee45
+        if ip_addr_result[0] == 0:
a1ee45
+            for eth in self.get_interface_name(ip_addr_result[1]):
a1ee45
+                # Most, if not all, IFs in the namespaces are going to be
a1ee45
+                # virtual. The '-a', '-c' and '-g' options are not likely to be
a1ee45
+                # supported so these ops are not copied from the network
a1ee45
+                # plugin.
a1ee45
+                self.add_cmd_outputs([
a1ee45
+                    cmd_prefix + "ethtool "+eth,
a1ee45
+                    cmd_prefix + "ethtool -i "+eth,
a1ee45
+                    cmd_prefix + "ethtool -k "+eth,
a1ee45
+                    cmd_prefix + "ethtool -S "+eth
a1ee45
+                ])
a1ee45
+
a1ee45
+        # As all of the bridges are in the "global namespace", we do not need
a1ee45
+        # to gather info on them.
a1ee45
+
a1ee45
+    def gen_pkg_tuple(self, packages):
a1ee45
+        names = []
a1ee45
+        for p in packages:
a1ee45
+            names.append(p % {"comp": self.component_name})
a1ee45
+        return tuple(names)
a1ee45
+
a1ee45
+
a1ee45
+class DebianNeutron(Neutron, DebianPlugin, UbuntuPlugin):
a1ee45
+    """OpenStack Neutron related information for Debian based distributions
a1ee45
+    """
a1ee45
+    package_list_template = [
a1ee45
+        '%(comp)s-common',
a1ee45
+        '%(comp)s-plugin-cisco',
a1ee45
+        '%(comp)s-plugin-linuxbridge-agent',
a1ee45
+        '%(comp)s-plugin-nicira',
a1ee45
+        '%(comp)s-plugin-openvswitch',
a1ee45
+        '%(comp)s-plugin-openvswitch-agent',
a1ee45
+        '%(comp)s-plugin-ryu',
a1ee45
+        '%(comp)s-plugin-ryu-agent',
a1ee45
+        '%(comp)s-server',
a1ee45
+        'python-%(comp)s',
a1ee45
+        'python-%(comp)sclient'
a1ee45
+    ]
a1ee45
+
a1ee45
+    def check_enabled(self):
a1ee45
+        return self.is_installed("%s-common" % self.component_name)
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(DebianNeutron, self).setup()
a1ee45
+        self.packages = self.gen_pkg_tuple(self.package_list_template)
a1ee45
+        self.add_copy_spec("/etc/sudoers.d/%s_sudoers" % self.component_name)
a1ee45
+
a1ee45
+
a1ee45
+class RedHatNeutron(Neutron, RedHatPlugin):
a1ee45
+    """OpenStack Neutron related information for Red Hat distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    package_list_template = [
a1ee45
+        'openstack-%(comp)s',
a1ee45
+        'openstack-%(comp)s-linuxbridge'
a1ee45
+        'openstack-%(comp)s-metaplugin',
a1ee45
+        'openstack-%(comp)s-openvswitch',
a1ee45
+        'openstack-%(comp)s-bigswitch',
a1ee45
+        'openstack-%(comp)s-brocade',
a1ee45
+        'openstack-%(comp)s-cisco',
a1ee45
+        'openstack-%(comp)s-hyperv',
a1ee45
+        'openstack-%(comp)s-midonet',
a1ee45
+        'openstack-%(comp)s-nec'
a1ee45
+        'openstack-%(comp)s-nicira',
a1ee45
+        'openstack-%(comp)s-plumgrid',
a1ee45
+        'openstack-%(comp)s-ryu',
a1ee45
+        'python-%(comp)s',
a1ee45
+        'python-%(comp)sclient'
a1ee45
+    ]
a1ee45
+
a1ee45
+    def check_enabled(self):
a1ee45
+        return self.is_installed("openstack-%s" % self.component_name)
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(RedHatNeutron, self).setup()
a1ee45
+        self.packages = self.gen_pkg_tuple(self.package_list_template)
a1ee45
+        self.add_copy_spec("/etc/sudoers.d/%s-rootwrap" % self.component_name)
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py
a1ee45
new file mode 100644
a1ee45
index 0000000..a4186af
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_nova.py
a1ee45
@@ -0,0 +1,152 @@
a1ee45
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
a1ee45
+# Copyright (C) 2012 Rackspace US, Inc.,
a1ee45
+#                    Justin Shepherd <jshepher@rackspace.com>
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackNova(Plugin):
a1ee45
+    """openstack nova related information
a1ee45
+    """
a1ee45
+    plugin_name = "openstack_nova"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack nova logs", "slow", True),
a1ee45
+                   ("cmds", "gathers openstack nova commands", "slow", False)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        if self.get_option("cmds"):
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage config list",
a1ee45
+                suggest_filename="nova_config_list")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage service list",
a1ee45
+                suggest_filename="nova_service_list")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage db version",
a1ee45
+                suggest_filename="nova_db_version")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage fixed list",
a1ee45
+                suggest_filename="nova_fixed_ip_list")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage floating list",
a1ee45
+                suggest_filename="nova_floating_ip_list")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage flavor list",
a1ee45
+                suggest_filename="nova_flavor_list")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage network list",
a1ee45
+                suggest_filename="nova_network_list")
a1ee45
+            self.add_cmd_output(
a1ee45
+                "nova-manage vm list",
a1ee45
+                suggest_filename="nova_vm_list")
a1ee45
+
a1ee45
+        if self.get_option("log"):
a1ee45
+            self.add_copy_spec("/var/log/nova/")
a1ee45
+
a1ee45
+        self.add_copy_spec("/etc/nova/")
a1ee45
+
a1ee45
+    def postproc(self):
a1ee45
+        protect_keys = [
a1ee45
+            "ldap_dns_password", "neutron_admin_password", "rabbit_password",
a1ee45
+            "qpid_password", "powervm_mgr_passwd", "virtual_power_host_pass",
a1ee45
+            "xenapi_connection_password", "password", "host_password",
a1ee45
+            "vnc_password", "connection", "sql_connection", "admin_password"
a1ee45
+        ]
a1ee45
+
a1ee45
+        regexp = r"((?m)^\s*#*(%s)\s*=\s*)(.*)" % "|".join(protect_keys)
a1ee45
+
a1ee45
+        for conf_file in ["/etc/nova/nova.conf", "/etc/nova/api-paste.ini"]:
a1ee45
+            self.do_file_sub(conf_file, regexp, r"\1*********")
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackNova(OpenStackNova, DebianPlugin, UbuntuPlugin):
a1ee45
+    """OpenStack nova related information for Debian based distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    nova = False
a1ee45
+    packages = (
a1ee45
+        'nova-api-ec2',
a1ee45
+        'nova-api-metadata',
a1ee45
+        'nova-api-os-compute',
a1ee45
+        'nova-api-os-volume',
a1ee45
+        'nova-common',
a1ee45
+        'nova-compute',
a1ee45
+        'nova-compute-kvm',
a1ee45
+        'nova-compute-lxc',
a1ee45
+        'nova-compute-qemu',
a1ee45
+        'nova-compute-uml',
a1ee45
+        'nova-compute-xcp',
a1ee45
+        'nova-compute-xen',
a1ee45
+        'nova-xcp-plugins',
a1ee45
+        'nova-consoleauth',
a1ee45
+        'nova-network',
a1ee45
+        'nova-scheduler',
a1ee45
+        'nova-volume',
a1ee45
+        'novnc',
a1ee45
+        'python-nova',
a1ee45
+        'python-novaclient',
a1ee45
+        'python-novnc'
a1ee45
+    )
a1ee45
+
a1ee45
+    def check_enabled(self):
a1ee45
+        self.nova = self.is_installed("nova-common")
a1ee45
+        return self.nova
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(DebianOpenStackNova, self).setup()
a1ee45
+        self.add_copy_specs(["/etc/sudoers.d/nova_sudoers"])
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackNova(OpenStackNova, RedHatPlugin):
a1ee45
+    """OpenStack nova related information for Red Hat distributions
a1ee45
+    """
a1ee45
+
a1ee45
+    nova = False
a1ee45
+    packages = (
a1ee45
+        'openstack-nova-common',
a1ee45
+        'openstack-nova-network',
a1ee45
+        'openstack-nova-conductor',
a1ee45
+        'openstack-nova-conductor',
a1ee45
+        'openstack-nova-scheduler',
a1ee45
+        'openstack-nova-console',
a1ee45
+        'openstack-nova-novncproxy',
a1ee45
+        'openstack-nova-compute',
a1ee45
+        'openstack-nova-api',
a1ee45
+        'openstack-nova-cert',
a1ee45
+        'openstack-nova-cells',
a1ee45
+        'openstack-nova-objectstore',
a1ee45
+        'python-nova',
a1ee45
+        'python-novaclient',
a1ee45
+        'novnc'
a1ee45
+    )
a1ee45
+
a1ee45
+    def check_enabled(self):
a1ee45
+        self.nova = self.is_installed("openstack-nova-common")
a1ee45
+        return self.nova
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        super(RedHatOpenStackNova, self).setup()
a1ee45
+        self.add_copy_specs([
a1ee45
+            "/etc/logrotate.d/openstack-nova",
a1ee45
+            "/etc/polkit-1/localauthority/50-local.d/50-nova.pkla",
a1ee45
+            "/etc/sudoers.d/nova",
a1ee45
+            "/etc/security/limits.d/91-nova.conf",
a1ee45
+            "/etc/sysconfig/openstack-nova-novncproxy"
a1ee45
+        ])
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py
a1ee45
new file mode 100644
a1ee45
--- /dev/null
a1ee45
+++ b/sos/plugins/openstack_swift.py
a1ee45
@@ -0,0 +1,62 @@
a1ee45
+# Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com>
a1ee45
+# Copyright (C) 2012 Rackspace US, Inc.,
a1ee45
+#               Justin Shepherd <jshepher@rackspace.com>
a1ee45
+# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com>
a1ee45
+
a1ee45
+# This program is free software; you can redistribute it and/or modify
a1ee45
+# it under the terms of the GNU General Public License as published by
a1ee45
+# the Free Software Foundation; either version 2 of the License, or
a1ee45
+# (at your option) any later version.
a1ee45
+
a1ee45
+# This program is distributed in the hope that it will be useful,
a1ee45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1ee45
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1ee45
+# GNU General Public License for more details.
a1ee45
+
a1ee45
+# You should have received a copy of the GNU General Public License
a1ee45
+# along with this program; if not, write to the Free Software
a1ee45
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a1ee45
+
a1ee45
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
a1ee45
+
a1ee45
+
a1ee45
+class OpenStackSwift(Plugin):
a1ee45
+    """OpenstackSwift related information."""
a1ee45
+    plugin_name = "openstack_swift"
a1ee45
+
a1ee45
+    option_list = [("log", "gathers openstack-swift logs", "slow", False)]
a1ee45
+
a1ee45
+    def setup(self):
a1ee45
+        # Swift
a1ee45
+        self.add_copy_spec("/etc/swift/")
a1ee45
+
a1ee45
+
a1ee45
+class DebianOpenStackSwift(OpenStackSwift, DebianPlugin, UbuntuPlugin):
a1ee45
+    """OpenStackSwift related information for Debian based distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'swift',
a1ee45
+        'swift-account',
a1ee45
+        'swift-container',
a1ee45
+        'swift-object',
a1ee45
+        'swift-proxy',
a1ee45
+        'swauth',
a1ee45
+        'python-swift',
a1ee45
+        'python-swauth'
a1ee45
+    )
a1ee45
+
a1ee45
+
a1ee45
+class RedHatOpenStackSwift(OpenStackSwift, RedHatPlugin):
a1ee45
+    """OpenStackSwift related information for Red Hat distributions."""
a1ee45
+
a1ee45
+    packages = (
a1ee45
+        'openstack-swift',
a1ee45
+        'openstack-swift-account',
a1ee45
+        'openstack-swift-container',
a1ee45
+        'openstack-swift-object',
a1ee45
+        'openstack-swift-proxy',
a1ee45
+        'swift',
a1ee45
+        'python-swiftclient'
a1ee45
+    )
a1ee45
+
a1ee45
+# vim: et ts=4 sw=4
a1ee45
-- 
a1ee45
1.9.3
a1ee45