Summary
ServiceConnection.identity raises TypeError for any connection that has no identity configured — every unix:// connection, and any ssh:// connection added without --identity.
Code (current main)
@cached_property
def identity(self):
"""Path: Returns Path to identity file for service connection."""
if self.attrs.get("identity"):
return Path(self.attrs.get("identity"))
return Path(self.attrs.get("Identity"))
When neither key is present this is Path(None).
Reproducer
Any host with a local unix:// connection in podman system connection list:
from podman.domain.config import PodmanConfig
cfg = PodmanConfig()
for name, svc in cfg.services.items():
print(name, svc.identity)
TypeError: argument should be a str or an os.PathLike object where
__fspath__ returns a str, not 'NoneType'
Merely enumerating the configured connections is enough to hit it — the caller does not have to be doing anything unusual.
Same result with a hand-written containers.conf containing an ssh destination with no identity = line, so it is not specific to unix sockets.
Expected
identity returns None when no identity is configured, and callers treat it as optional.
Environment
podman-py 5.6.0 (Fedora python3-podman-5.6.0-4.fc44), podman 5.8.4 client and server, rootless, Python 3.14. Code path re-checked against current main before filing.
Note
This also breaks PodmanClient(connection=...); filed separately since the fix there is different.
Summary
ServiceConnection.identityraisesTypeErrorfor any connection that has no identity configured — everyunix://connection, and anyssh://connection added without--identity.Code (current
main)When neither key is present this is
Path(None).Reproducer
Any host with a local
unix://connection inpodman system connection list:Merely enumerating the configured connections is enough to hit it — the caller does not have to be doing anything unusual.
Same result with a hand-written
containers.confcontaining an ssh destination with noidentity =line, so it is not specific to unix sockets.Expected
identityreturnsNonewhen no identity is configured, and callers treat it as optional.Environment
podman-py 5.6.0 (Fedora
python3-podman-5.6.0-4.fc44), podman 5.8.4 client and server, rootless, Python 3.14. Code path re-checked against currentmainbefore filing.Note
This also breaks
PodmanClient(connection=...); filed separately since the fix there is different.