I'm in a situation where I need to pass some texts to a prompt generate by a API (seems for API it's a pretty weird behavior, this is the first time I ran into this), like below:
kvm_cli = libvirt.open("qemu+ssh://[email protected]/system")
then a prompt shows up asking for the ssh password (password for 10.0.10.8 is:
), I have to manually type it there in order to move on and yield the kvm_cli
object I needed.
I tried to use the pexpect
module to deal with this however it's for OS command line instead of API.
It's also possible to work around this by using ssh certification files but it's not a favorable authentication approach in our scenario.
Since our wrapper to the 'open' method is not interactive, we cannot ask the user to input the password, do you guys have any thought how could I address it?