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

Test TestSSHUserConfig.test_missing_hostkey fails with paramiko < 3.2 #1290

Open
0EVSG opened this issue Feb 9, 2025 · 0 comments
Open

Test TestSSHUserConfig.test_missing_hostkey fails with paramiko < 3.2 #1290

0EVSG opened this issue Feb 9, 2025 · 0 comments

Comments

@0EVSG
Copy link

0EVSG commented Feb 9, 2025

Describe the bug

When running the tests with paramiko < 3.2 installed, the test TestSSHUserConfig.test_missing_hostkey fails due to missing PKey method from_type_string:

__________________________________ TestSSHUserConfig.test_missing_hostkey ___________________________________

self = <tests.test_connectors.test_sshuserclient.TestSSHUserConfig testMethod=test_missing_hostkey>

    def test_missing_hostkey(self):
        client = SSHClient()
        policy = AskPolicy()
        example_hostname = "new_host"
        example_keytype = "ecdsa-sha2-nistp256"
        example_key = (
            "AAAAE2VjZHNhLXNoYTItbmlzdHAyNT"
            "YAAAAIbmlzdHAyNTYAAABBBHNp1NM"
            "ZjxPBuuKwIPfkVJqWaH3oUtW137kIW"
            "P4PlCyACt8zVIIimFhIpwRUidcf7jw"
            "VWPAJvfBjEPqewDApnZQ="
        )

>       key = PKey.from_type_string(
            example_keytype,
            b64decode(example_key),
        )
E       AttributeError: type object 'PKey' has no attribute 'from_type_string'

tests/test_connectors/test_sshuserclient.py:241: AttributeError

According to paramiko docs this method was only added in paramiko 3.2, but the required paramiko version is >= 2.7 in setup.py.

To Reproduce

I stumbled upon this while trying to update the FreeBSD port, where paramiko is at version 2.11 currently. The failing test should be reproducible in any environment with paramiko < 3.2 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant