dbclient: fix -y and save hostkey to known_hosts
The -y should behave as -oStrictHostKeyChecking=accept-new. So we don't just accept new keys but store them to recheck if they weren't changed.
Without this the -y is same as -y -y if the know_hosts is empty.
The bug fix may be breaking if some script by mistake expected that the -y is just to disable the checking at all.
to make it more clear I just removed
if (!cli_opts.always_accept_key).
That's it.
The problem is with virtual hostname which can be used to connect to a cluster and end up on any node. So the user@virtualhostnm can have multiple different hostkeys... If you add it to the known hosts and the next time the connection ends up on another node you get a different hostkey..
For this reason we use the -y -y option.
I think this is already covered in extra changes I added to #269 . Let me know if there is something missing.
Checked, fixed. Thank you