Conversation
added 2 commits
August 13, 2026 11:34
…py, simplify validateEntitlementKey in cli.py
terc1997
requested changes
Sep 21, 2026
terc1997
left a comment
Contributor
There was a problem hiding this comment.
The PR on python-devops will change the implementation in the CLI.
…or as None in utils.py
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[patch] Move SSLError handling to python-devops/src/mas/devops/utils.py, simplify validateEntitlementKey in cli.py
Summary
Fixes entitlement key validation failing with an unhelpful error message when the CLI cannot reach
cp.icr.iodue to an SSL certificate verification error (e.g. corporate proxy or firewall performing TLS interception).Previously, all failures — whether SSL errors or genuine authentication failures — were surfaced as the same generic error, leaving customers unable to determine whether their key was wrong or the network was blocking the connection.
Changes
python/src/mas/cli/cli.pyRequestsExceptionimport to catch unexpected non-SSL network errors re-raised fromutils.pyvalidateEntitlementKey()— now catchesRequestsException(non-SSL network errors) and returnsFalse;SSLErroris handled inutils.pyand arrives asNonepromptForEntitlementKey()— SSL-specific warning messages and interactive menu retained (unchanged)python/tests/unit/test_entitlement_key_validation.pytest_validate_with_ssl_error— changedside_effect=SSLErrortoreturn_value=Noneto reflect thatutils.pynow absorbsSSLErrorinternally and returnsNonetest_validate_with_network_errorandtest_validate_with_timeout— changed toside_effect=ConnectionError/Timeoutto reflect thatutils.pyre-raises these andcli.pycatches them and returnsFalseTesting
Reproduced both scenarios manually inside the MAS CLI container.
Case 1 — SSL error (corporate proxy / self-signed certificate)
Result:
Warning: SSL certificate verification failed — could not reach cp.icr.iowith explanation that the key may still be valid and options to try again / continue / quitCase 2 — Wrong entitlement key
Result:
Warning: IBM entitlement key validation failedwith options to try again / continue / quitLinked issue
Fixes MASCORE-16263
Closes #2519