Skip to content

Commit a736e83

Browse files
committed
suse: add SLESPolicy and fix OpenSuSEPolicy detection
SuSEPolicy.check() always returns False, requiring concrete subclasses to override it. OpenSuSEPolicy never did, and no SLESPolicy existed, so both openSUSE and SLES systems fell back to GenericLinuxPolicy which uses a no-op PackageManager with an empty package dict. This caused all package-gated plugins (rdma, roce, infiniband, etc.) to show as inactive regardless of what was installed. Add SLESPolicy with os_release_name/os_release_id matching SLES /etc/os-release values, and fix OpenSuSEPolicy to override check() via LinuxPolicy.check() so both policies are correctly detected and RpmPackageManager is used for package lookups. Signed-off-by: Michael Filanov <mfilanov@nvidia.com>
1 parent d690337 commit a736e83

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

sos/policies/distros/suse.py

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def get_local_name(self):
6161
class OpenSuSEPolicy(SuSEPolicy):
6262
vendor = "SuSE"
6363
vendor_urls = [('Community Website', 'https://www.opensuse.org/')]
64-
os_release_name = "OpenSuSE"
65-
os_release_file = '/etc/SUSE-brand'
64+
os_release_name = "openSUSE Leap"
65+
os_release_id = "opensuse-leap"
6666
msg = _("""\
6767
This command will collect diagnostic and configuration \
6868
information from this %(os_release_name)s system and installed \
@@ -76,10 +76,31 @@ class OpenSuSEPolicy(SuSEPolicy):
7676
%(vendor_text)s
7777
""")
7878

79-
def __init__(self, sysroot=None, init=None, probe_runtime=True,
80-
remote_exec=None):
81-
super().__init__(sysroot=sysroot, init=init,
82-
probe_runtime=probe_runtime,
83-
remote_exec=remote_exec)
79+
@classmethod
80+
def check(cls, remote=''):
81+
return LinuxPolicy.check.__func__(cls, remote)
82+
83+
84+
class SLESPolicy(SuSEPolicy):
85+
vendor = "SUSE"
86+
vendor_urls = [('Distribution Website', 'https://www.suse.com/')]
87+
os_release_name = "SLES"
88+
os_release_id = "sles"
89+
msg = _("""\
90+
This command will collect diagnostic and configuration \
91+
information from this %(os_release_name)s system and installed \
92+
applications.
93+
94+
An archive containing the collected information will be \
95+
generated in %(tmpdir)s and may be provided to a %(vendor)s \
96+
support representative.
97+
98+
No changes will be made to system configuration.
99+
%(vendor_text)s
100+
""")
101+
102+
@classmethod
103+
def check(cls, remote=''):
104+
return LinuxPolicy.check.__func__(cls, remote)
84105

85106
# vim: set et ts=4 sw=4 :

0 commit comments

Comments
 (0)