diff options
-rw-r--r-- | sos/plugins/__init__.py | 11 | ||||
-rw-r--r-- | sos/plugins/ceph.py | 1 | ||||
-rw-r--r-- | sos/plugins/maas.py | 2 | ||||
-rw-r--r-- | sos/sosreport.py | 1 |
4 files changed, 12 insertions, 3 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 86534fec..779e4be2 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -1684,6 +1684,17 @@ class Plugin(object): only if manually specified in the command line.""" return True + def add_default_collections(self): + """Based on the class attrs defined for plugin enablement, add a + standardized set of collections before we call the plugin's own setup() + method. + """ + # For any service used for enablement checks, collect its current + # status if it exists + for service in self.services: + if self.is_service(service): + self.add_service_status(service) + def setup(self): """Collect the list of files declared by the plugin. This method may be overridden to add further copy_specs, forbidden_paths, and diff --git a/sos/plugins/ceph.py b/sos/plugins/ceph.py index 2beafa77..259b80c5 100644 --- a/sos/plugins/ceph.py +++ b/sos/plugins/ceph.py @@ -116,7 +116,6 @@ class Ceph(Plugin, RedHatPlugin, UbuntuPlugin): "ceph %s --format json-pretty" % s for s in ceph_cmds ], subdir="json_output") - self.add_service_status(self.services) for service in self.services: self.add_journal(units=service) diff --git a/sos/plugins/maas.py b/sos/plugins/maas.py index 6ec1adf4..0b70cee7 100644 --- a/sos/plugins/maas.py +++ b/sos/plugins/maas.py @@ -66,8 +66,6 @@ class Maas(Plugin, UbuntuPlugin): "apt-cache policy python-django-*", ]) - self.add_service_status(self.services) - for service in self.services: self.add_journal(units=service) diff --git a/sos/sosreport.py b/sos/sosreport.py index 46ed4a2f..5f3fb411 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -977,6 +977,7 @@ class SoSReport(object): for plugname, plug in self.loaded_plugins: try: plug.archive = self.archive + plug.add_default_collections() plug.setup() self.env_vars.update(plug._env_vars) if self.opts.verify: |