fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Regarding fexpect in fabric python


From: Kirti Kumbhar
Subject: [Fab-user] Regarding fexpect in fabric python
Date: Thu, 23 Nov 2017 22:31:10 -0800

Hi,

I am using fabric python library for interacting  with remote machine shell.using fexpect but when I send list in with expecting(prompt) then it doesn't exit from that.
Below I have paste the code snap.

from fabric.api import *
from fabric.context_managers import settings
from ilogue.fexpect import expect, expecting, run


prompts = []
prompts += expect('Username:','admin')
prompts += expect('Password:','admin')
prompts += expect('OPR>','help')
prompts += expect('OPR>', 'show opr-user')


with settings(host_string="address@hidden", warn_only=True):
    env.password = "address@hidden"
    with cd('/home/alef/opr'):
         with expecting(prompts):
                run('./go_opr_cli', )




after executing run it's control doesn't go to next list element.I want to help.

Thanks & Regards,
Kirti D Kumbhar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]