diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-10-22 16:17:18 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-10-22 16:17:18 +0100 |
commit | df4fd5e890481200577e2f1cfe1231097f4dacfd (patch) | |
tree | b13c5c5c7b00a1c75bc423b9ead95d531abd3ca3 | |
parent | c8c4998086589f198f9dfa77c6dddcc17e518fdf (diff) | |
download | sos-df4fd5e890481200577e2f1cfe1231097f4dacfd.tar.gz |
Split out Cinder, Dashboard, Nova and Quantum from OpenStack
Split out support for the OpenStack Cinder, Dashboard, Nova and
Quantum components from the single OpenStack plug-in.
Signed-off-by: Jeremy Agee <jagee@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/openstack.py | 115 | ||||
-rw-r--r-- | sos/plugins/openstack_cinder.py | 57 | ||||
-rw-r--r-- | sos/plugins/openstack_dashboard.py | 82 | ||||
-rw-r--r-- | sos/plugins/openstack_nova.py | 148 | ||||
-rw-r--r-- | sos/plugins/openstack_quantum.py | 90 |
5 files changed, 357 insertions, 135 deletions
diff --git a/sos/plugins/openstack.py b/sos/plugins/openstack.py deleted file mode 100644 index 488fe6ce..00000000 --- a/sos/plugins/openstack.py +++ /dev/null @@ -1,115 +0,0 @@ -## Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com> -## Copyright (C) 2012 Rackspace US, Inc., Justin Shepherd <jshepher@rackspace.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 OpenStack(Plugin): - """openstack related information - """ - plugin_name = "openstack" - - option_list = [("log", "gathers all openstack logs", "slow", False)] - - def setup(self): - # Nova - self.add_cmd_output( - "nova-manage config list 2>/dev/null | sort", - suggest_filename="nova_config_list") - self.add_cmd_output( - "nova-manage service list 2>/dev/null", - suggest_filename="nova_service_list") - self.add_cmd_output( - "nova-manage db version 2>/dev/null", - suggest_filename="nova_db_version") - self.add_cmd_output( - "nova-manage fixed list 2>/dev/null", - suggest_filename="nova_fixed_ip_list") - self.add_cmd_output( - "nova-manage floating list 2>/dev/null", - suggest_filename="nova_floating_ip_list") - self.add_cmd_output( - "nova-manage flavor list 2>/dev/null", - suggest_filename="nova_flavor_list") - self.add_cmd_output( - "nova-manage network list 2>/dev/null", - suggest_filename="nova_network_list") - self.add_cmd_output( - "nova-manage vm list 2>/dev/null", - suggest_filename="nova_vm_list") - self.add_copy_specs(["/etc/nova/", - "/var/log/nova/"]) - - # Quantum - self.add_copy_specs(["/etc/quantum/", - "/var/log/quantum/"]) - - -class DebianOpenStack(OpenStack, DebianPlugin, UbuntuPlugin): - """OpenStack related information for Debian based distributions - """ - - packages = ('melange', - 'nova-api-ec2', - 'nova-api-metadata', - 'nova-api-os-compute', - 'nova-api-os-volume', - 'nova-common', - 'nova-compute', - 'nova-compute-kvm', - 'nova-compute-lxc', - 'nova-compute-qemu', - 'nova-compute-uml', - 'nova-compute-xcp', - 'nova-compute-xen', - 'nova-xcp-plugins', - 'nova-consoleauth', - 'nova-network', - 'nova-scheduler', - 'nova-volume', - 'novnc', - 'python-melange', - 'python-nova', - 'python-novaclient', - 'python-novnc', - - def setup(self): - # Nova - self.add_copy_spec("/etc/sudoers.d/nova_sudoers") - - # Quantum - self.add_copy_spec("/etc/sudoers.d/quantum_sudoers") - - -class RedHatOpenStack(OpenStack, RedHatPlugin): - """OpenStack related information for Red Hat distributions - """ - - packages = ('openstack-nova', - 'python-nova', - 'python-novaclient', - 'python-openstackclient') - - def setup(self): - # Nova - self.add_copy_specs([ - "/var/lib/nova/", - "/etc/polkit-1/localauthority/50-local.d/50-nova.pkla", - "/etc/sudoers.d/nova" - ]) diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py index b3951698..97eb8fba 100644 --- a/sos/plugins/openstack_cinder.py +++ b/sos/plugins/openstack_cinder.py @@ -1,6 +1,7 @@ ## 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., Flavio Percoco <fpercoco@redhat.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 @@ -16,30 +17,36 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos import plugins +import os +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class OpenStackCinder(plugins.Plugin): - """OpenstackCinder related information.""" +class OpenStackCinder(Plugin): + """openstack cinder related information + """ plugin_name = "openstack-cinder" - option_list = [("log", "gathers openstack-cinder logs", "slow", False)] + option_list = [("log", "gathers openstack cinder logs", "slow", True), + ("db", "gathers openstack cinder db version", "slow", False)] def setup(self): - # Cinder - self.add_cmd_output( - "cinder-manage db version", - suggest_filename="cinder_db_version") - self.add_copy_specs(["/etc/cinder/", - "/var/log/cinder/"]) + if self.option_enabled("db"): + self.add_cmd_output( + "cinder-manage db version", + suggest_filename="cinder_db_version") + self.add_copy_specs(["/etc/cinder/"]) -class DebianOpenStackCinder(OpenStackCinder, - plugins.DebianPlugin, - plugins.UbuntuPlugin): - """OpenStackCinder related information for Debian based distributions.""" + if self.option_enabled("log"): + self.add_copy_specs(["/var/log/cinder/"]) + +class DebianOpenStackCinder(OpenStackCinder, DebianPlugin, UbuntuPlugin): + """OpenStack Cinder related information for Debian based distributions + """ + + cinder = False packages = ('cinder-api', 'cinder-backup', 'cinder-common', @@ -48,17 +55,27 @@ class DebianOpenStackCinder(OpenStackCinder, 'python-cinder', 'python-cinderclient') - def setup(self): - # Cinder - self.add_copy_spec("/etc/sudoers.d/cinder_sudoers") + def check_enabled(self): + self.cinder = self.is_installed("cinder-common") + return self.cinder + def setup(self): + super(DebianOpenStackCinder, self).setup() -class RedHatOpenStackCinder(OpenStackCinder, plugins.RedHatPlugin): - """OpenStackCinder related information for Red Hat distributions.""" +class RedHatOpenStackCinder(OpenStackCinder, RedHatPlugin): + """OpenStack related information for Red Hat distributions + """ + cinder = False packages = ('openstack-cinder', + 'python-cinder', 'python-cinderclient') + def check_enabled(self): + self.cinder = self.is_installed("openstack-cinder") + return self.cinder + def setup(self): - # Cinder + super(RedHatOpenStackCinder, self).setup() self.add_copy_specs(["/etc/sudoers.d/cinder"]) + diff --git a/sos/plugins/openstack_dashboard.py b/sos/plugins/openstack_dashboard.py new file mode 100644 index 00000000..5e0cb489 --- /dev/null +++ b/sos/plugins/openstack_dashboard.py @@ -0,0 +1,82 @@ +## 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 OpenStackDashboard(Plugin): + """openstack dashboard related information + """ + plugin_name = "openstack-dashboard" + + option_list = [("log", "gathers openstack httpd logs", "slow", True)] + + def setup(self): + self.add_copy_specs(["/etc/openstack-dashboard/"]) + + +class DebianOpenStackDashboard(OpenStackDashboard, DebianPlugin): + """OpenStack related information for Debian based distributions + """ + + packages = ('openstack-dashboard', + 'openstack-dashboard-apache') + dashboard = False + + def check_enabled(self): + self.dashboard = self.is_installed("openstack-dashboard") + return self.dashboard + + def setup(self): + super(DebianOpenStackDashboard, self).setup() + self.add_copy_specs(["/etc/apache2/sites-available/"]) + +class UbuntuOpenStackDashboard(OpenStackDashboard, UbuntuPlugin): + """OpenStack related information for Ubuntu based distributions + """ + + packages = ('openstack-dashboard', + 'openstack-dashboard-ubuntu-theme') + dashboard = False + + def check_enabled(self): + self.dashboard = self.is_installed("openstack-dashboard") + return self.dashboard + + def setup(self): + super(UbuntuOpenStackDashboard, self).setup() + self.add_copy_specs(["/etc/apache2/conf.d/openstack-dashboard.conf"]) + +class RedHatOpenStackDashboard(OpenStackDashboard, RedHatPlugin): + """OpenStack related information for Red Hat distributions + """ + + dashboard = False + packages = ('openstack-dashboard') + + def check_enabled(self): + self.dashboard = self.is_installed("openstack-dashboard") + return self.dashboard + + def setup(self): + super(RedHatOpenStackDashboard, 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_nova.py b/sos/plugins/openstack_nova.py new file mode 100644 index 00000000..e9932b48 --- /dev/null +++ b/sos/plugins/openstack_nova.py @@ -0,0 +1,148 @@ +## 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. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class OpenStackNova(Plugin): + """openstack nova related information + """ + plugin_name = "openstack-nova" + + option_list = [("log", "gathers openstack nova logs", "slow", True), + ("cmds", "gathers openstack nova commands", "slow", False)] + + def setup(self): + if self.option_enabled("cmds"): + self.add_cmd_output( + "nova-manage config list 2>/dev/null | sort", + suggest_filename="nova_config_list") + self.add_cmd_output( + "nova-manage service list 2>/dev/null", + suggest_filename="nova_service_list") + self.add_cmd_output( + "nova-manage db version 2>/dev/null", + suggest_filename="nova_db_version") + self.add_cmd_output( + "nova-manage fixed list 2>/dev/null", + suggest_filename="nova_fixed_ip_list") + self.add_cmd_output( + "nova-manage floating list 2>/dev/null", + suggest_filename="nova_floating_ip_list") + self.add_cmd_output( + "nova-manage flavor list 2>/dev/null", + suggest_filename="nova_flavor_list") + self.add_cmd_output( + "nova-manage network list 2>/dev/null", + suggest_filename="nova_network_list") + self.add_cmd_output( + "nova-manage vm list 2>/dev/null", + suggest_filename="nova_vm_list") + + if self.option_enabled("log"): + self.add_copy_spec("/var/log/nova/") + + self.add_copy_spec("/etc/nova/") + + def postproc(self): + protect_passwords = { + "/etc/nova/nova.conf": [ + "ldap_dns_password", "neutron_admin_password", + "rabbit_password", "qpid_password", "powervm_mgr_passwd", + "xenapi_connection_password", "virtual_power_host_pass", + "password", "host_password", "vnc_password", "connection", + "sql_connection"], + "/etc/nova/api-paste.ini": ["admin_password"] + } + + for conf_file, keys in protect_passwords.items(): + for password_key in keys: + regexp = r"(?m)^(%s\s*=\s*)(.*)" % password_key + self.do_file_sub(conf_file, regexp, r"\1*********") + + +class DebianOpenStackNova(OpenStackNova, DebianPlugin, UbuntuPlugin): + """OpenStack nova related information for Debian based distributions + """ + + nova = False + packages = ('nova-api-ec2', + 'nova-api-metadata', + 'nova-api-os-compute', + 'nova-api-os-volume', + 'nova-common', + 'nova-compute', + 'nova-compute-kvm', + 'nova-compute-lxc', + 'nova-compute-qemu', + 'nova-compute-uml', + 'nova-compute-xcp', + 'nova-compute-xen', + 'nova-xcp-plugins', + 'nova-consoleauth', + 'nova-network', + 'nova-scheduler', + 'nova-volume', + 'novnc', + 'python-nova', + 'python-novaclient', + 'python-novnc') + + def check_enabled(self): + self.nova = self.is_installed("nova-common") + return self.nova + + def setup(self): + # Nova + super(DebianOpenStackNova, self).setup() + self.add_copy_spec(["/etc/sudoers.d/nova_sudoers"]) + + +class RedHatOpenStackNova(OpenStackNova, RedHatPlugin): + """OpenStack nova related information for Red Hat distributions + """ + + nova = False + packages = ('openstack-nova-common', + 'openstack-nova-network', + 'openstack-nova-conductor', + 'openstack-nova-conductor', + 'openstack-nova-scheduler', + 'openstack-nova-console', + 'openstack-nova-novncproxy', + 'openstack-nova-compute', + 'openstack-nova-api', + 'openstack-nova-cert', + 'openstack-nova-cells', + 'openstack-nova-objectstore', + 'python-nova', + 'python-novaclient', + 'novnc') + + def check_enabled(self): + self.nova = self.is_installed("openstack-nova-common") + return self.nova + + def setup(self): + super(RedHatOpenStackNova, self).setup() + self.add_copy_specs([ + "/etc/logrotate.d/openstack-nova", + "/etc/polkit-1/localauthority/50-local.d/50-nova.pkla", + "/etc/sudoers.d/nova", + "/etc/sysconfig/openstack-nova-novncproxy.sysconfig", + "/var/security/limits.d/91-nova.conf"]) diff --git a/sos/plugins/openstack_quantum.py b/sos/plugins/openstack_quantum.py new file mode 100644 index 00000000..9ce59b15 --- /dev/null +++ b/sos/plugins/openstack_quantum.py @@ -0,0 +1,90 @@ +## 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 OpenStackQuantum(Plugin): + """openstack quantum related information + """ + plugin_name = "openstack-quantum" + + option_list = [("log", "gathers openstack quantum logs", "slow", True)] + + def setup(self): + self.add_copy_specs(["/etc/quantum/"]) + + if self.option_enabled("log"): + self.add_copy_specs(["/var/log/quantum/"]) + + +class DebianOpenStackQuantum(OpenStackQuantum, DebianPlugin, UbuntuPlugin): + """OpenStack Quantum related information for Debian based distributions + """ + + quantum = False + packages = ('quantum-common', + 'quantum-plugin-cisco', + 'quantum-plugin-linuxbridge-agent', + 'quantum-plugin-nicira', + 'quantum-plugin-openvswitch', + 'quantum-plugin-openvswitch-agent', + 'quantum-plugin-ryu', + 'quantum-plugin-ryu-agent', + 'quantum-server', + 'python-quantum', + 'python-quantumclient') + + def check_enabled(self): + self.quantum = self.is_installed("quantum-common") + return self.quantum + + def setup(self): + super(DebianOpenStackQuantum, self).setup() + self.add_copy_spec(["/etc/sudoers.d/quantum_sudoers"]) + + +class RedHatOpenStackQuantum(OpenStackQuantum, RedHatPlugin): + """OpenStack Quantum related information for Red Hat distributions + """ + + quantum = False + packages = ('openstack-quantum-bigswitch', + 'openstack-quantum-brocade', + 'openstack-quantum-cisco', + 'openstack-quantum-hyperv', + 'openstack-quantum-linuxbridge', + 'openstack-quantum-metaplugin', + 'openstack-quantum-midonet', + 'openstack-quantum-nec', + 'openstack-quantum-nicira', + 'openstack-quantum-openvswitch', + 'openstack-quantum-plumgrid', + 'openstack-quantum-ryu', + 'python-quantum', + 'python-quantumclient', + 'openstack-quantum') + + def check_enabled(self): + self.quantum = self.is_installed("openstack-quantum") + return self.quantum + + def setup(self): + super(RedHatOpenStackQuantum, self).setup() |