diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-10-15 19:17:47 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-10-15 19:17:47 +0100 |
commit | e125afd8567c45762fa32f2a13988d87d3edc008 (patch) | |
tree | 00a45a1ce92a0cf7fdb992651148ab49f787c1cc | |
parent | 0ed431a385d238a0ee41770e6e0758ea722a9ee1 (diff) | |
download | sos-e125afd8567c45762fa32f2a13988d87d3edc008.tar.gz |
Add OpenStack Keystone and Horizon plug-ins
Split out the Keystone and Horizon support from the main OpenStack
plug-in and put them in their own modules.
Signed-off-by: Jeremy Agee <jagee@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/openstack.py | 19 | ||||
-rw-r--r-- | sos/plugins/openstack_horizon.py | 74 | ||||
-rw-r--r-- | sos/plugins/openstack_keystone.py | 74 |
3 files changed, 149 insertions, 18 deletions
diff --git a/sos/plugins/openstack.py b/sos/plugins/openstack.py index 21155f94..2f696fa9 100644 --- a/sos/plugins/openstack.py +++ b/sos/plugins/openstack.py @@ -56,26 +56,16 @@ class OpenStack(Plugin): self.add_copy_specs(["/etc/nova/", "/var/log/nova/"]) - # Keystone - self.add_copy_specs(["/etc/keystone/", - "/var/log/keystone/"]) - # Quantum self.add_copy_specs(["/etc/quantum/", "/var/log/quantum/"]) - def postproc(self): - self.do_file_sub('/etc/keystone/keystone.conf', - r"(admin_password\s*=\s*)(.*)", - r"\1******") - class DebianOpenStack(OpenStack, DebianPlugin, UbuntuPlugin): """OpenStack related information for Debian based distributions """ - packages = ('keystone', - 'melange', + packages = ('melange', 'nova-api-ec2', 'nova-api-metadata', 'nova-api-os-compute', @@ -94,7 +84,6 @@ class DebianOpenStack(OpenStack, DebianPlugin, UbuntuPlugin): 'nova-scheduler', 'nova-volume', 'novnc', - 'openstack-dashboard', 'quantum-common', 'quantum-plugin-cisco', 'quantum-plugin-linuxbridge-agent', @@ -104,9 +93,6 @@ class DebianOpenStack(OpenStack, DebianPlugin, UbuntuPlugin): 'quantum-plugin-ryu', 'quantum-plugin-ryu-agent', 'quantum-server', - 'python-django-horizon', - 'python-keystone', - 'python-keystoneclient', 'python-melange', 'python-nova', 'python-novaclient', @@ -127,11 +113,8 @@ class RedHatOpenStack(OpenStack, RedHatPlugin): """ packages = ('openstack-nova', - 'openstack-dashboard', - 'openstack-keystone', 'openstack-quantum', 'python-nova', - 'python-keystoneclient', 'python-novaclient', 'python-openstackclient', 'python-quantumclient') diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py new file mode 100644 index 00000000..31ee5616 --- /dev/null +++ b/sos/plugins/openstack_horizon.py @@ -0,0 +1,74 @@ +## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com> +## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.com> +## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com> + +### This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +import os + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class OpenStackHorizon(Plugin): + """openstack horizon related information + """ + + plugin_name = "openstack-horizon" + option_list = [("log", "gathers openstack horizon logs", "slow", True)] + + def setup(self): + self.add_copy_specs(["/etc/openstack-dashboard/"]) + if self.option_enabled("log"): + self.add_copy_specs(["/var/log/horizon/"]) + + +class DebianOpenStackHorizon(OpenStackHorizon, DebianPlugin): + """OpenStack Horizon related information for Debian based distributions + """ + + packages = ('python-django-horizon', + 'openstack-dashboard', + 'openstack-dashboard-apache') + + def setup(self): + super(DebianOpenStackHorizon, self).setup() + self.add_copy_specs(["/etc/apache2/sites-available/"]) + + +class UbuntuOpenStackHorizon(OpenStackHorizon, UbuntuPlugin): + """OpenStack Horizon related information for Ubuntu based distributions + """ + + packages = ('python-django-horizon', + 'openstack-dashboard', + 'openstack-dashboard-ubuntu-theme') + + def setup(self): + super(UbuntuOpenStackHorizon, self).setup() + self.add_copy_specs(["/etc/apache2/conf.d/openstack-dashboard.conf"]) + + +class RedHatOpenStackHorizon(OpenStackHorizon, RedHatPlugin): + """OpenStack Horizon related information for Red Hat distributions + """ + + packages = ('python-django-horizon', + 'openstack-dashboard') + + def setup(self): + super(RedHatOpenStackHorizon, self).setup() + self.add_copy_specs(["/etc/httpd/conf.d/openstack-dashboard.conf"]) + if self.option_enabled("log"): + self.add_copy_specs(["/var/log/httpd/"]) diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py new file mode 100644 index 00000000..96748d31 --- /dev/null +++ b/sos/plugins/openstack_keystone.py @@ -0,0 +1,74 @@ +## Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com> + +### This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +import os + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class OpenStackKeystone(Plugin): + """openstack keystone related information + """ + plugin_name = "openstack-keystone" + + option_list = [("log", "gathers openstack keystone logs", "slow", True), + ("nopw", "dont gathers keystone passwords", "slow", True)] + + def setup(self): + self.add_copy_specs(["/etc/keystone/default_catalog.templates", + "/etc/keystone/keystone.conf", + "/etc/keystone/logging.conf", + "/etc/keystone/policy.json"]) + + if self.option_enabled("log"): + self.add_copy_specs(["/var/log/keystone/"]) + + def postproc(self): + if self.option_enabled("nopw"): + self.do_file_sub('/etc/keystone/keystone.conf', + r"(?m)^(admin_password.*=)(.*)", + r"\1 ******") + self.do_file_sub('/etc/keystone/keystone.conf', + r"(?m)^(admin_token.*=)(.*)", + r"\1 ******") + self.do_file_sub('/etc/keystone/keystone.conf', + r"(?m)^(connection.*=.*mysql://)(.*)(:)(.*)(@)(.*)", + r"\1\2:******@\6") + self.do_file_sub('/etc/keystone/keystone.conf', + r"(?m)^(password.*=)(.*)", + r"\1 ******") + self.do_file_sub('/etc/keystone/keystone.conf', + r"(?m)^(ca_password.*=)(.*)", + r"\1 ******") + + +class DebianOpenStackKeystone(OpenStackKeystone, DebianPlugin, UbuntuPlugin): + """OpenStack Keystone related information for Debian based distributions + """ + + packages = ('keystone', + 'python-keystone', + 'python-keystoneclient') + + +class RedHatOpenStackKeystone(OpenStackKeystone, RedHatPlugin): + """OpenStack Keystone related information for Red Hat distributions + """ + + packages = ('openstack-keystone', + 'python-keystone', + 'python-django-openstack-auth', + 'python-keystoneclient') |