aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2019-10-14 11:31:11 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-10-23 17:27:00 +0100
commit2747b107cdc5b7b2813a58c9b5a2a83371417ae4 (patch)
treee66396dddeab84d5b5fb5033306ff6f6008e1b05
parent4413c11e9031a4b2c790d87ca96fb0095e1fbdeb (diff)
downloadsos-2747b107cdc5b7b2813a58c9b5a2a83371417ae4.tar.gz
[redhat] Automatically enable cantboot preset in emergency/rescue mode
If sos is being run in emergency or rescue mode on a RH family system, then automatically load the cantboot preset by default, instead of other package-based presets. Resolves: #1831 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/policies/redhat.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index 3b6ab7cd..8f86f5b6 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -300,6 +300,10 @@ support representative.
return False
def probe_preset(self):
+ # Emergency or rescue mode?
+ for target in ["rescue", "emergency"]:
+ if self.init_system.is_running("%s.target" % target):
+ return self.find_preset(CB)
# Package based checks
if self.pkg_by_name("satellite-common") is not None:
return self.find_preset(RH_SATELLITE)