fabric - connect to machines with wierd prompts

对着背影说爱祢 提交于 2019-12-25 06:48:00

问题


Since fabric is based on paramiko, is there any API to connect to virtual appliance with ssh-process having weird interactive shells ?

How can fabric interact with processes acting as such shells.

e.g. VM acting as switch having prompt 'switch-> ' when login is done over ssh. fabfile.py need to feed commands thereafter. once such command is to deploy images over tftpboots. The VM provides both telnet/ssh interface with user/password)

I tried below code, but it does not work -

 @task
 taskA():
      with settings(prompts={'switch-> ' : 'bringkickstart img.bin' }):
          run('save image')

来源:https://stackoverflow.com/questions/37402849/fabric-connect-to-machines-with-wierd-prompts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!