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 hostname printing in error messages #3343

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion src/rhsm/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,15 @@ class ConnectionOSErrorException(ConnectionException):
"""

def __init__(self, host: str, port: int, handler: str, exc: OSError):
self.host = host
self._host = host
self.port = port
self.handler = handler
self.exc = exc

@property
def host(self) -> str:
return normalized_host(self._host)


class ConnectionType(enum.Enum):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/subscription_manager/cli_command/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def main(self, args: Optional[List[str]] = None) -> Optional[int]:
system_exit(
os.EX_UNAVAILABLE,
_("Unable to reach the server at {host}:{port}{handler}").format(
host=self.no_auth_cp.host,
host=connection.normalized_host(self.no_auth_cp.host),
port=self.no_auth_cp.ssl_port,
handler=self.no_auth_cp.handler,
),
Expand Down