Skip to content

Commit

Permalink
Merge pull request #3397 from candlepin/mhorky/cct-322-dnf-in-container
Browse files Browse the repository at this point in the history
fix: Hide subscription management "errors" in container mode
  • Loading branch information
jirihnidek authored May 30, 2024
2 parents c15f4a7 + a3265e4 commit 0de0c38
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 0de0c38

Please sign in to comment.