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

RHEL-7206: Small change of message printed by dnf plugin #3356

Merged
merged 1 commit into from
Nov 10, 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
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