[S507] fix doc recommended fix (#9347)

paramiko `set_missing_host_key_policy` has mandatory positional arg.
The [current
documentation](https://docs.astral.sh/ruff/rules/ssh-no-host-key-verification/#example)
leads to non-running code

```
>>> from paramiko import client
>>> ssh_client = client.SSHClient()
>>> ssh_client.set_missing_host_key_policy()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: SSHClient.set_missing_host_key_policy() missing 1 required positional argument: 'policy'
```

This PR modifies the documentation to set the policy to the [default
`RejectPolicy`](https://docs.paramiko.org/en/latest/api/client.html#paramiko.client.SSHClient.set_missing_host_key_policy)

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
This commit is contained in:
Mikael Arguedas 2024-01-02 02:59:11 +01:00 committed by GitHub
parent 0a0020583f
commit d0a1e201a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ use crate::checkers::ast::Checker;
/// from paramiko import client /// from paramiko import client
/// ///
/// ssh_client = client.SSHClient() /// ssh_client = client.SSHClient()
/// ssh_client.set_missing_host_key_policy() /// ssh_client.set_missing_host_key_policy(client.RejectPolicy)
/// ``` /// ```
/// ///
/// ## References /// ## References