aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2022-12-13 15:46:52 -0500
committerJake Hunsaker <jhunsake@redhat.com>2023-01-03 09:22:33 -0500
commit6b3c84da03fb9be9be22f88c163d18e3e4397b21 (patch)
tree795c0eab200573c1ff024c949f12b980f6235cb6
parent699654ada97c62bbd1a082b13de8a72b31464763 (diff)
downloadsos-6b3c84da03fb9be9be22f88c163d18e3e4397b21.tar.gz
[ceph_*] Correct enablement trigger for ceph plugins
The previous changes that broke up the ceph plugin into smaller component specific plugins inadvertently broke the plugin enablement by overriding the `check_enabled()` function to check for file presence under a directory. This in turn replaced the standard checks, such as the presence of certain containers. Fix this by removing the method override, and leveraging the `files` tuple against the component-specific directory into which the globs were trying to check. Further, update the container name regexes for enablement as they have changed slightly since the initial plugin creation. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/ceph_common.py2
-rw-r--r--sos/report/plugins/ceph_mds.py7
-rw-r--r--sos/report/plugins/ceph_mgr.py8
-rw-r--r--sos/report/plugins/ceph_mon.py7
-rw-r--r--sos/report/plugins/ceph_osd.py7
-rw-r--r--sos/report/plugins/ceph_rgw.py7
6 files changed, 11 insertions, 27 deletions
diff --git a/sos/report/plugins/ceph_common.py b/sos/report/plugins/ceph_common.py
index ebe70e0b..c4af6fe3 100644
--- a/sos/report/plugins/ceph_common.py
+++ b/sos/report/plugins/ceph_common.py
@@ -17,7 +17,7 @@ class Ceph_Common(Plugin, RedHatPlugin, UbuntuPlugin):
plugin_name = 'ceph_common'
profiles = ('storage', 'virt', 'container')
- containers = ('ceph-(mon|rgw|osd).*',)
+ containers = ('ceph-(.*-)?(mon|rgw|osd).*',)
ceph_hostname = gethostname()
packages = (
diff --git a/sos/report/plugins/ceph_mds.py b/sos/report/plugins/ceph_mds.py
index c105ee5d..da48cb13 100644
--- a/sos/report/plugins/ceph_mds.py
+++ b/sos/report/plugins/ceph_mds.py
@@ -7,17 +7,14 @@
# See the LICENSE file in the source distribution for further information.
from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-import glob
class CephMDS(Plugin, RedHatPlugin, UbuntuPlugin):
short_desc = 'CEPH mds'
plugin_name = 'ceph_mds'
profiles = ('storage', 'virt', 'container')
- containers = ('ceph-fs.*',)
-
- def check_enabled(self):
- return True if glob.glob('/var/lib/ceph/mds/*/*') else False
+ containers = ('ceph-(.*-)?fs.*',)
+ files = ('/var/lib/ceph/mds/',)
def setup(self):
self.add_file_tags({
diff --git a/sos/report/plugins/ceph_mgr.py b/sos/report/plugins/ceph_mgr.py
index be0a489b..2aaf1a9d 100644
--- a/sos/report/plugins/ceph_mgr.py
+++ b/sos/report/plugins/ceph_mgr.py
@@ -7,7 +7,6 @@
# See the LICENSE file in the source distribution for further information.
from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-import glob
class CephMGR(Plugin, RedHatPlugin, UbuntuPlugin):
@@ -16,11 +15,8 @@ class CephMGR(Plugin, RedHatPlugin, UbuntuPlugin):
plugin_name = 'ceph_mgr'
profiles = ('storage', 'virt', 'container')
-
- containers = ('ceph-mgr.*',)
-
- def check_enabled(self):
- return True if glob.glob('/var/lib/ceph/mgr/*/*') else False
+ files = ('/var/lib/ceph/mgr/',)
+ containers = ('ceph-(.*)?mgr.*',)
def setup(self):
self.add_file_tags({
diff --git a/sos/report/plugins/ceph_mon.py b/sos/report/plugins/ceph_mon.py
index 61461add..b0a12ba1 100644
--- a/sos/report/plugins/ceph_mon.py
+++ b/sos/report/plugins/ceph_mon.py
@@ -7,7 +7,6 @@
# See the LICENSE file in the source distribution for further information.
from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-import glob
class CephMON(Plugin, RedHatPlugin, UbuntuPlugin):
@@ -16,10 +15,8 @@ class CephMON(Plugin, RedHatPlugin, UbuntuPlugin):
plugin_name = 'ceph_mon'
profiles = ('storage', 'virt', 'container')
- containers = ('ceph-mon.*',)
-
- def check_enabled(self):
- return True if glob.glob('/var/lib/ceph/mon/*/*') else False
+ containers = ('ceph-(.*)?mon.*',)
+ files = ('/var/lib/ceph/mon/',)
def setup(self):
self.add_file_tags({
diff --git a/sos/report/plugins/ceph_osd.py b/sos/report/plugins/ceph_osd.py
index 86fb0ef0..91da7965 100644
--- a/sos/report/plugins/ceph_osd.py
+++ b/sos/report/plugins/ceph_osd.py
@@ -7,7 +7,6 @@
# See the LICENSE file in the source distribution for further information.
from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-import glob
class CephOSD(Plugin, RedHatPlugin, UbuntuPlugin):
@@ -16,10 +15,8 @@ class CephOSD(Plugin, RedHatPlugin, UbuntuPlugin):
plugin_name = 'ceph_osd'
profiles = ('storage', 'virt', 'container')
- containers = ('ceph-osd.*',)
-
- def check_enabled(self):
- return True if glob.glob('/var/lib/ceph/osd/*/*') else False
+ containers = ('ceph-(.*)?osd.*',)
+ files = ('/var/lib/ceph/osd/',)
def setup(self):
self.add_file_tags({
diff --git a/sos/report/plugins/ceph_rgw.py b/sos/report/plugins/ceph_rgw.py
index f5afc0dd..79f3c449 100644
--- a/sos/report/plugins/ceph_rgw.py
+++ b/sos/report/plugins/ceph_rgw.py
@@ -7,7 +7,6 @@
# See the LICENSE file in the source distribution for further information.
from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-import glob
class CephRGW(Plugin, RedHatPlugin, UbuntuPlugin):
@@ -16,10 +15,8 @@ class CephRGW(Plugin, RedHatPlugin, UbuntuPlugin):
plugin_name = 'ceph_rgw'
profiles = ('storage', 'virt', 'container', 'webserver')
- containers = ('ceph-rgw.*',)
-
- def check_enabled(self):
- return True if glob.glob('/var/lib/ceph/radosgw/*/*') else False
+ containers = ('ceph-(.*)?rgw.*',)
+ files = ('/var/lib/ceph/radosgw',)
def setup(self):
self.add_copy_spec('/var/log/ceph/ceph-client.rgw*.log',