mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
fix: Check public_key is not None first
This commit is contained in:
parent
209a1415d7
commit
618280f7fe
1 changed files with 2 additions and 2 deletions
|
|
@ -191,8 +191,8 @@ class AnsibleHCloudSSHKey(AnsibleHCloud):
|
|||
|
||||
force = self.module.params.get("force")
|
||||
public_key = self.module.params.get("public_key")
|
||||
fingerprint = ssh_public_key_md5_fingerprint(public_key)
|
||||
if fingerprint != self.hcloud_ssh_key.fingerprint:
|
||||
fingerprint = ssh_public_key_md5_fingerprint(public_key) if public_key is not None else None
|
||||
if fingerprint is not None and fingerprint != self.hcloud_ssh_key.fingerprint:
|
||||
if not force:
|
||||
self.module.warn(
|
||||
"A new public key with same name has been detected. "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue