Skip to content

Commit

Permalink
Merge pull request #3356 from candlepin/jhnidek/RHEL-7206
Browse files Browse the repository at this point in the history
RHEL-7206: Small change of message printed by dnf plugin
  • Loading branch information
ptoscano authored Nov 10, 2023
2 parents 425aa7c + 145b60c commit 6af0339
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/plugins/dnf/subscription_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os
import logging
import shutil

from subscription_manager import injection as inj
from subscription_manager.action_client import ProfileActionClient
Expand Down Expand Up @@ -48,6 +49,13 @@
"""
)

not_registered_warning_rhc = _(
"""
This system is not registered with an entitlement server. \
You can use "rhc" or "subscription-manager" to register.
"""
)

no_subs_warning = _(
"""
This system is registered with an entitlement server, but is not receiving updates. You can use \
Expand Down Expand Up @@ -182,7 +190,10 @@ def _warn_or_give_usage_message():
ent_dir = inj.require(inj.ENT_DIR)
# Don't warn people to register if we see entitlements, but no identity:
if not identity.is_valid() and len(ent_dir.list_valid()) == 0:
msg = not_registered_warning
if shutil.which("rhc") is not None:
msg = not_registered_warning_rhc
else:
msg = not_registered_warning
elif len(ent_dir.list_valid()) == 0 and not is_simple_content_access(identity=identity):
msg = no_subs_warning
finally:
Expand Down

0 comments on commit 6af0339

Please sign in to comment.