Skip to content

Commit 9cb8e04

Browse files
committed
[subscription_manager] Add condition to run deprecated options
Some subscription_manager options have been deprecated in RHEL 10, and when they are run thrown an error. This fix adds a check for OS version and if it's not RHEL 10, runs the deprecated commands. Related: RHEL-130523 Signed-off-by: Jose Castillo <[email protected]>
1 parent 122caf9 commit 9cb8e04

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sos/report/plugins/subscription_manager.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,23 @@ def setup(self):
6767
"/var/log/rhsm/rhsmcertd.log"])
6868
self.add_cmd_output("subscription-manager identity",
6969
tags="subscription_manager_id")
70-
self.add_cmd_output("subscription-manager list --consumed",
71-
tags="subscription_manager_list_consumed")
7270
self.add_cmd_output("subscription-manager list --installed",
7371
tags="subscription_manager_installed")
7472
self.add_cmd_output([
75-
"subscription-manager list --available",
76-
"subscription-manager list --all --available",
7773
"subscription-manager release --show",
7874
"subscription-manager release --list",
7975
"syspurpose show",
8076
"subscription-manager syspurpose --show",
8177
"subscription-manager status",
8278
"subscription-manager facts",
8379
], cmd_as_tag=True)
80+
# Deprecated options in RHEL 10, that throw errors when run
81+
if self.policy.dist_version() < 10:
82+
self.add_cmd_output([
83+
"subscription-manager list --available",
84+
"subscription-manager list --all --available",
85+
"subscription-manager list --consumed",
86+
], cmd_as_tag=True)
8487
self.add_cmd_output("rhsm-debug system --sos --no-archive "
8588
"--no-subscriptions --destination "
8689
f"{self.get_cmd_output_path()}")

0 commit comments

Comments
 (0)