diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2018-09-06 13:56:20 -0400 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-09-10 16:44:36 +0100 |
commit | 4440c9094d853a452cbff6f9801fc7d47352e9b4 (patch) | |
tree | 754ad5aa7596c2605df6198cd9d32863e3c2ac6f | |
parent | 6e79c4b4a4f32fa549708dbb8c8b9af73ab8ff61 (diff) | |
download | sos-4440c9094d853a452cbff6f9801fc7d47352e9b4.tar.gz |
[atomic] Define valid preset for RHEL Atomic
Defines an 'atomic' preset for use with the RedHatAtomic policy for RHEL
Atomic Host. Fixes sos being unable to run due to the preset probe
returning a string rather than a preset.
Resolves: #1418
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/policies/redhat.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index b494de3c..e1e417f3 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -325,6 +325,12 @@ No changes will be made to system configuration. ATOMIC = "atomic" ATOMIC_RELEASE_STR = "Atomic" +ATOMIC_DESC = "Red Hat Enterprise Linux Atomic Host" + +atomic_presets = { + ATOMIC: PresetDefaults(name=ATOMIC, desc=ATOMIC_DESC, note=NOTE_TIME, + opts=_opts_verify) +} class RedHatAtomicPolicy(RHELPolicy): @@ -347,6 +353,10 @@ organization before being passed to any third party. %(vendor_text)s """) + def __init__(self, sysroot=None): + super(RedHatAtomicPolicy, self).__init__(sysroot=sysroot) + self.register_presets(atomic_presets) + @classmethod def check(cls): atomic = False @@ -363,7 +373,10 @@ organization before being passed to any third party. return atomic def probe_preset(self): - return ATOMIC + if self.pkg_by_name('atomic-openshift'): + return self.find_preset(RHOCP) + + return self.find_preset(ATOMIC) class FedoraPolicy(RedHatPolicy): |