mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
don't collect data from other sosreport plugins
Tower plugin shouldn't collect data that other sosreport plugins collect. Further, few code optimizations in calling sos API are made. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import sos
|
|||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
SOSREPORT_TOWER_COMMANDS = [
|
SOSREPORT_TOWER_COMMANDS = [
|
||||||
"ansible --version", # ansible core version
|
|
||||||
"awx-manage --version", # tower version
|
"awx-manage --version", # tower version
|
||||||
"awx-manage list_instances", # tower cluster configuration
|
"awx-manage list_instances", # tower cluster configuration
|
||||||
"awx-manage run_dispatcher --status", # tower dispatch worker status
|
"awx-manage run_dispatcher --status", # tower dispatch worker status
|
||||||
@@ -23,15 +22,11 @@ SOSREPORT_TOWER_COMMANDS = [
|
|||||||
|
|
||||||
SOSREPORT_TOWER_DIRS = [
|
SOSREPORT_TOWER_DIRS = [
|
||||||
"/etc/tower/",
|
"/etc/tower/",
|
||||||
"/etc/ansible/",
|
|
||||||
"/etc/supervisord.d/",
|
"/etc/supervisord.d/",
|
||||||
"/etc/nginx/",
|
"/etc/nginx/",
|
||||||
"/var/log/tower",
|
"/var/log/tower",
|
||||||
"/var/log/nginx",
|
"/var/log/nginx",
|
||||||
"/var/log/supervisor",
|
"/var/log/supervisor",
|
||||||
"/var/log/syslog",
|
|
||||||
"/var/log/udev",
|
|
||||||
"/var/log/kern*",
|
|
||||||
"/var/log/dist-upgrade",
|
"/var/log/dist-upgrade",
|
||||||
"/var/log/installer",
|
"/var/log/installer",
|
||||||
"/var/log/unattended-upgrades",
|
"/var/log/unattended-upgrades",
|
||||||
@@ -50,7 +45,7 @@ SOSREPORT_FORBIDDEN_PATHS = [
|
|||||||
if LooseVersion(sos.__version__) >= LooseVersion('3.0'):
|
if LooseVersion(sos.__version__) >= LooseVersion('3.0'):
|
||||||
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
|
from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
|
||||||
|
|
||||||
class tower(Plugin, RedHatPlugin, UbuntuPlugin):
|
class Tower(Plugin, RedHatPlugin, UbuntuPlugin):
|
||||||
'''Collect Ansible Tower related information'''
|
'''Collect Ansible Tower related information'''
|
||||||
plugin_name = "tower"
|
plugin_name = "tower"
|
||||||
|
|
||||||
@@ -59,16 +54,14 @@ if LooseVersion(sos.__version__) >= LooseVersion('3.0'):
|
|||||||
for path in SOSREPORT_TOWER_DIRS:
|
for path in SOSREPORT_TOWER_DIRS:
|
||||||
self.add_copy_spec(path)
|
self.add_copy_spec(path)
|
||||||
|
|
||||||
for path in SOSREPORT_FORBIDDEN_PATHS:
|
self.add_forbidden_path(SOSREPORT_FORBIDDEN_PATHS)
|
||||||
self.add_forbidden_path(path)
|
|
||||||
|
|
||||||
for command in SOSREPORT_TOWER_COMMANDS:
|
self.add_cmd_output(SOSREPORT_TOWER_COMMANDS)
|
||||||
self.add_cmd_output(command)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import sos.plugintools
|
import sos.plugintools
|
||||||
|
|
||||||
class tower(sos.plugintools.PluginBase):
|
class Tower(sos.plugintools.PluginBase):
|
||||||
'''Collect Ansible Tower related information'''
|
'''Collect Ansible Tower related information'''
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user