Repository navigation
Return None from ServiceConnection.identity when no identity is configured - #679
Closed
rjmcgee53192 wants to merge 1 commit into
Closed
rjmcgee53192 wants to merge 1 commit into
rjmcgee53192 wants to merge 1 commit into
Conversation
Accessing .identity on a connection without an identity file — every unix:// connection, and ssh:// connections added without --identity — fell through to Path(None) and raised TypeError, so simply enumerating the configured connections crashed. Return None instead, and leave the identity argument unset in PodmanClient when a connection has none rather than passing the string "None" to the SSH layer. Fixes containers#652 Signed-off-by: rjmcgee53192 <[email protected]>
Member
|
Sorry, but there is already a PR that is fixing #652. Closing this in favor of #656 @rjmcgee53192 Please review #656 |
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.
Fixes #652
Problem
ServiceConnection.identityfell through toPath(self.attrs.get("Identity"))when neither the
identity(containers.conf) norIdentity(podman-connections.json) key was present. That is
Path(None), which raises:So merely enumerating the configured connections crashed for every local
unix://connection, and for anyssh://connection added without--identity.Change
podman/domain/config.py:identitynow returnsNonewhen no identityis configured, and a
Pathotherwise. Both key spellings keep working.podman/client.py: the two call sites that read a connection's identitynow leave the
identityargument unset when the connection has none,instead of stringifying the value (which would have turned
Noneintothe literal string
"None"). Behaviour is unchanged when an identity isconfigured or passed explicitly.
Tests
PodmanConfigTestCaseNoIdentityinpodman/tests/unit/test_config.pycovers a
unix://connection and anssh://connection with no identityin podman-connections.json, including through
active_service.podman/tests/unit/test_utils.pyexcluded — it fails to collect on a machine without a
podmanbinary,both before and after this change).
ruff checkandruff format --checkpass on the touched files.