Python Fabric Respond To Prompts In Output
Solution 1:
If you look at the documentation on env.passwords it says:
This dictionary is largely for internal use, and is filled automatically as a per-host-string password cache. Keys are full host strings and values are passwords (strings).
The important note is the warning following the above:
Warning
If you modify or generate this dict manually, you must use fully qualified host strings with user and port values. See the link above for details on the host string API.
Following the above warning, make sure that the hostname is FQDN and perhaps even add the port number :22
and see if it works.
As for the prompt, that should have worked as long as you ran the command inside the with
block (which I can't tell from your sample code). Also check if the prompt is followed by a space, if not remove it from your prompts
key.
Post a Comment for "Python Fabric Respond To Prompts In Output"