diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-07-25 10:50:35 -0700 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-07-25 10:50:35 -0700 |
commit | e7f4a66d40bc1cff8fcb24fda53336c9883c645c (patch) | |
tree | 9688eab42158c61d876e2afb1c6e154080ef5c3e | |
parent | d65075a050097087a822381546a8b9bd1ab35220 (diff) | |
parent | 38163948406013e63dd6d1408c0fc17da78d0749 (diff) | |
download | sos-e7f4a66d40bc1cff8fcb24fda53336c9883c645c.tar.gz |
Merge pull request #167 from ivoks/juju
Refactored OpenStack plugin
-rw-r--r-- | sos/plugins/juju.py | 3 | ||||
-rw-r--r-- | sos/plugins/openstack.py | 145 |
2 files changed, 72 insertions, 76 deletions
diff --git a/sos/plugins/juju.py b/sos/plugins/juju.py index 64b4f1db..c7bbdf17 100644 --- a/sos/plugins/juju.py +++ b/sos/plugins/juju.py @@ -25,3 +25,6 @@ class Juju(Plugin, UbuntuPlugin): def setup(self): self.add_copy_specs(["/var/log/juju", "/var/lib/juju"]) + + self.add_cmd_output("juju -v status") + self.add_cmd_output("juju -v get-constraints") diff --git a/sos/plugins/openstack.py b/sos/plugins/openstack.py index 8c521365..a35a9e85 100644 --- a/sos/plugins/openstack.py +++ b/sos/plugins/openstack.py @@ -27,6 +27,68 @@ class OpenStack(Plugin): option_list = [("log", "gathers all openstack logs", "slow", False)] + def setup(self): + # Nova + if os.path.exists("nova-manage"): + 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/"]) + + # Glance + if os.path.exists("glance-manage"): + self.add_cmd_output( + "glance-manage db_version", + suggest_filename="glance_db_version") + self.add_copy_specs(["/etc/glance/", + "/var/log/glance/"]) + + # Cinder + if os.path.exists("cinder-manage"): + self.addCmdOutput( + "cinder-manage db version", + suggest_filename="cinder_db_version") + self.add_copy_specs(["/etc/cinder/", + "/var/log/cinder/"]) + + # Keystone + self.add_copy_specs(["/etc/keystone/", + "/var/log/keystone/"]) + + # Quantum + self.add_copy_specs(["/etc/quantum/", + "/var/log/quantum/"]) + + # Swift + self.add_copy_specs("/etc/swift/") + + 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 @@ -95,61 +157,13 @@ class DebianOpenStack(OpenStack, DebianPlugin, UbuntuPlugin): def setup(self): # Nova - if os.path.exists("nova-manage"): - 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/", - "/etc/default/nova-volume", - "/etc/sudoers.d/nova_sudoers", - "/etc/logrotate.d/nova-*"]) + self.add_copy_specs("/etc/sudoers.d/nova_sudoers") + # Cinder - if os.path.exists("/usr/bin/cinder-manage"): - self.addCmdOutput( - "/usr/bin/cinder-manage db version", - suggest_filename="cinder_db_version") - self.addCopySpecs(["/etc/cinder/", - "/var/log/cinder/", - "/etc/logrotate.d/cinder-*"]) - # Glance - if os.path.exists("glance-manage"): - self.add_cmd_output( - "glance-manage db_version", - suggest_filename="glance_db_version") - self.add_copy_specs(["/etc/glance/", - "/var/log/glance/", - "/etc/logrotate.d/glance-*"]) - # Keystone - self.add_copy_specs(["/etc/keystone/", - "/var/log/keystone/", - "/etc/logrotate.d/keystone"]) - # Swift - self.add_copy_specs(["/etc/swift/"]) + self.add_copy_specs("/etc/sudoers.d/cinder_sudoers") + # Quantum - self.add_copy_specs(["/etc/quantum/", - "/var/log/quantum/"]) + self.add_copy_specs("/etc/sudoers.d/quantum_sudoers") class RedHatOpenStack(OpenStack, RedHatPlugin): @@ -181,27 +195,6 @@ class RedHatOpenStack(OpenStack, RedHatPlugin): self.add_cmd_output("openstack-status") # Nova - self.add_copy_specs(["/etc/nova/", - "/var/log/nova/", - "/var/lib/nova/", + self.add_copy_specs(["/var/lib/nova/", "/etc/polkit-1/localauthority/50-local.d/50-nova.pkla", - "/etc/sudoers.d/nova", - "/etc/logrotate.d/openstack-nova"]) - - # Glance - self.add_copy_specs(["/etc/glance/", - "/var/log/glance/", - "/etc/logrotate.d/openstack-glance"]) - - # 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******") + "/etc/sudoers.d/nova"]) |