Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugins/ubuntu] Do not load tls module if not loaded #3327

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions sos/report/plugins/ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# See the LICENSE file in the source distribution for further information.

from sos.report.plugins import Plugin, UbuntuPlugin
from sos.report.plugins import Plugin, UbuntuPlugin, SoSPredicate
from sos.utilities import is_executable


Expand All @@ -30,8 +30,11 @@ def setup(self):
ua_tools_status = 'pro status'
else:
ua_tools_status = 'ubuntu-advantage status'
self.add_cmd_output(ua_tools_status)
self.add_cmd_output("%s --format json" % ua_tools_status)
ua_pred = SoSPredicate(self, kmods=['tls'])
self.add_cmd_output(ua_tools_status,
pred=ua_pred, changes=True)
self.add_cmd_output("%s --format json" % ua_tools_status,
pred=ua_pred, changes=True)

if not self.get_option("all_logs"):
self.add_copy_spec([
Expand Down