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

fix: Hide subscription management "errors" in container mode #3397

Merged
merged 1 commit into from
May 30, 2024
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
5 changes: 3 additions & 2 deletions src/plugins/dnf/subscription_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def _config(self):
if os.getuid() == 0:
# Try to update entitlement certificates and redhat.repo file
self._update(cache_only)
self._warn_or_give_usage_message()
if not config.in_container():
self._warn_or_give_usage_message()
else:
logger.info(_("Not root, Subscription Management repositories not updated"))
self._warn_expired()
Expand Down Expand Up @@ -159,7 +160,7 @@ def _update(cache_only):
# valid entitlement certificates, but does not yet have any identity.
# We have access to the content, so we shouldn't be reporting missing
# identity certificate.
if not identity.is_valid() and len(ent_dir.list_valid()) == 0:
if not config.in_container() and not identity.is_valid() and len(ent_dir.list_valid()) == 0:
logger.info(_("Unable to read consumer identity"))

if config.in_container():
Expand Down
Loading