Skip to content

Commit

Permalink
f!
Browse files Browse the repository at this point in the history
(cherry picked from commit dfbbc5c)
  • Loading branch information
bcoca committed Oct 24, 2024
1 parent bae95e7 commit 40a6e17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,15 +1167,15 @@ def ssh_key_gen(self):
self.module.warn('Overwriting existing ssh key private file "%s"' % ssh_key_file)
overwrite = 'y'
else:
self.module.warn(f'Found existing ssh key private file "%s", no force, so skipping ssh-keygen generation' % ssh_key_file)
self.module.warn('Found existing ssh key private file "%s", no force, so skipping ssh-keygen generation' % ssh_key_file)
return (None, 'Key already exists, use "force: yes" to overwrite', '')

if os.path.exists(pub_file):
if self.force:
self.module.warn(f'Overwriting existing ssh key public file "%s"' % pub_file)
self.module.warn('Overwriting existing ssh key public file "%s"' % pub_file)
os.unlink(pub_file)
else:
self.module.warn(f'Found existing ssh key public file "%s", no force, so skipping ssh-keygen generation' % pub_file)
self.module.warn('Found existing ssh key public file "%s", no force, so skipping ssh-keygen generation' % pub_file)
return (None, 'Public key already exists, use "force: yes" to overwrite', '')

cmd = [self.module.get_bin_path('ssh-keygen', True)]
Expand Down

0 comments on commit 40a6e17

Please sign in to comment.