bundlewrap/hooks/known_hosts.py
2023-07-28 10:00:16 +02:00

10 lines
351 B
Python

from os.path import expanduser
def apply_start(repo, target, nodes, interactive=False, **kwargs):
with open(expanduser('~/.ssh/known_hosts_ckn'), 'w+') as file:
file.write('\n'.join(sorted(
repo.libs.ssh.known_hosts_entry_for(node)
for node in repo.nodes
if node.has_bundle('ssh')
)))