Blame SOURCES/sos-bz1626159-atomic-attribute-error.patch

b72d26
From 4440c9094d853a452cbff6f9801fc7d47352e9b4 Mon Sep 17 00:00:00 2001
b72d26
From: Jake Hunsaker <jhunsake@redhat.com>
b72d26
Date: Thu, 6 Sep 2018 13:56:20 -0400
b72d26
Subject: [PATCH] [atomic] Define valid preset for RHEL Atomic
b72d26
b72d26
Defines an 'atomic' preset for use with the RedHatAtomic policy for RHEL
b72d26
Atomic Host. Fixes sos being unable to run due to the preset probe
b72d26
returning a string rather than a preset.
b72d26
b72d26
Resolves: #1418
b72d26
b72d26
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
b72d26
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
b72d26
---
b72d26
 sos/policies/redhat.py | 15 ++++++++++++++-
b72d26
 1 file changed, 14 insertions(+), 1 deletion(-)
b72d26
b72d26
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
b72d26
index b494de3c..e1e417f3 100644
b72d26
--- a/sos/policies/redhat.py
b72d26
+++ b/sos/policies/redhat.py
b72d26
@@ -325,6 +325,12 @@ No changes will be made to system configuration.
b72d26
 
b72d26
 ATOMIC = "atomic"
b72d26
 ATOMIC_RELEASE_STR = "Atomic"
b72d26
+ATOMIC_DESC = "Red Hat Enterprise Linux Atomic Host"
b72d26
+
b72d26
+atomic_presets = {
b72d26
+    ATOMIC: PresetDefaults(name=ATOMIC, desc=ATOMIC_DESC, note=NOTE_TIME,
b72d26
+                           opts=_opts_verify)
b72d26
+}
b72d26
 
b72d26
 
b72d26
 class RedHatAtomicPolicy(RHELPolicy):
b72d26
@@ -347,6 +353,10 @@ organization before being passed to any third party.
b72d26
 %(vendor_text)s
b72d26
 """)
b72d26
 
b72d26
+    def __init__(self, sysroot=None):
b72d26
+        super(RedHatAtomicPolicy, self).__init__(sysroot=sysroot)
b72d26
+        self.register_presets(atomic_presets)
b72d26
+
b72d26
     @classmethod
b72d26
     def check(cls):
b72d26
         atomic = False
b72d26
@@ -363,7 +373,10 @@ organization before being passed to any third party.
b72d26
         return atomic
b72d26
 
b72d26
     def probe_preset(self):
b72d26
-        return ATOMIC
b72d26
+        if self.pkg_by_name('atomic-openshift'):
b72d26
+            return self.find_preset(RHOCP)
b72d26
+
b72d26
+        return self.find_preset(ATOMIC)
b72d26
 
b72d26
 
b72d26
 class FedoraPolicy(RedHatPolicy):
b72d26
-- 
b72d26
2.17.1
b72d26